Skip to content
Snippets Groups Projects
Commit 37e7f063 authored by Jan Möbius's avatar Jan Möbius
Browse files

Some consts added

parent 94b005f6
Branches
Tags
1 merge request!133Removed glut
......@@ -434,8 +434,8 @@ updateVBO() {
// *--*--*----*-*
QFontMetricsF metric(qfont_);
qreal avgWidth = metric.averageCharWidth();
int height = nearestPowerOfTwo(metric.height());
float lastCharRight = 0.0f;
const int height = nearestPowerOfTwo(metric.height());
const float lastCharRight = 0.0f;
for (unsigned int i = 0; i < text_.size(); ++i) {
// left and right vertex coordinates
......@@ -459,14 +459,14 @@ updateVBO() {
metricWidth += leftBearing + rightBearing;
#endif
float widthTx = (float) metricWidth / (float) imageWidth_;
float heightTx = (float) height/ (float) imageHeight_;
const float widthTx = (float) metricWidth / (float) imageWidth_;
const float heightTx = (float) height/ (float) imageHeight_;
// 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
float leftTx = ((float) charToIndex_[text_[i]].first ) / (float) columns_;
float rightTx = leftTx + widthTx;
float bottomTx = charToIndex_[text_[i]].second / (float) rows_;
float topTx = bottomTx + heightTx;
const float leftTx = ((float) charToIndex_[text_[i]].first ) / (float) columns_;
const float rightTx = leftTx + widthTx;
const float bottomTx = charToIndex_[text_[i]].second / (float) rows_;
const float topTx = bottomTx + heightTx;
// bottom left
vertexBuffer_.push_back(left);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment