Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
37e7f063
Commit
37e7f063
authored
Feb 21, 2019
by
Jan Möbius
Browse files
Some consts added
parent
94b005f6
Changes
1
Show whitespace changes
Inline
Side-by-side
libs_required/ACG/Scenegraph/TextNode.cc
View file @
37e7f063
...
@@ -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.0
f
;
const
float
lastCharRight
=
0.0
f
;
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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment