Commit 37e7f063 authored by Jan Möbius's avatar Jan Möbius
Browse files

Some consts added

parent 94b005f6
...@@ -434,8 +434,8 @@ updateVBO() { ...@@ -434,8 +434,8 @@ updateVBO() {
// *--*--*----*-* // *--*--*----*-*
QFontMetricsF metric(qfont_); QFontMetricsF metric(qfont_);
qreal avgWidth = metric.averageCharWidth(); qreal avgWidth = metric.averageCharWidth();
int height = nearestPowerOfTwo(metric.height()); const int height = nearestPowerOfTwo(metric.height());
float lastCharRight = 0.0f; const float lastCharRight = 0.0f;
for (unsigned int i = 0; i < text_.size(); ++i) { for (unsigned int i = 0; i < text_.size(); ++i) {
// left and right vertex coordinates // left and right vertex coordinates
...@@ -459,14 +459,14 @@ updateVBO() { ...@@ -459,14 +459,14 @@ updateVBO() {
metricWidth += leftBearing + rightBearing; metricWidth += leftBearing + rightBearing;
#endif #endif
float widthTx = (float) metricWidth / (float) imageWidth_; const float widthTx = (float) metricWidth / (float) imageWidth_;
float heightTx = (float) height/ (float) imageHeight_; const float heightTx = (float) height/ (float) imageHeight_;
// get the starting position of the character in the texture // get the starting position of the character in the texture
// note that the characters are drawn aligned to the bottom left in in the texture // note that the characters are drawn aligned to the bottom left in in the texture
float leftTx = ((float) charToIndex_[text_[i]].first ) / (float) columns_; const float leftTx = ((float) charToIndex_[text_[i]].first ) / (float) columns_;
float rightTx = leftTx + widthTx; const float rightTx = leftTx + widthTx;
float bottomTx = charToIndex_[text_[i]].second / (float) rows_; const float bottomTx = charToIndex_[text_[i]].second / (float) rows_;
float topTx = bottomTx + heightTx; const float topTx = bottomTx + heightTx;
// bottom left // bottom left
vertexBuffer_.push_back(left); vertexBuffer_.push_back(left);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment