Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenFlipper
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenFlipper-Free
OpenFlipper
Commits
37e7f063
Commit
37e7f063
authored
6 years ago
by
Jan Möbius
Browse files
Options
Downloads
Patches
Plain Diff
Some consts added
parent
94b005f6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!133
Removed glut
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs_required/ACG/Scenegraph/TextNode.cc
+8
-8
8 additions, 8 deletions
libs_required/ACG/Scenegraph/TextNode.cc
with
8 additions
and
8 deletions
libs_required/ACG/Scenegraph/TextNode.cc
+
8
−
8
View file @
37e7f063
...
...
@@ -434,8 +434,8 @@ updateVBO() {
// *--*--*----*-*
QFontMetricsF
metric
(
qfont_
);
qreal
avgWidth
=
metric
.
averageCharWidth
();
int
height
=
nearestPowerOfTwo
(
metric
.
height
());
float
lastCharRight
=
0.0
f
;
const
int
height
=
nearestPowerOfTwo
(
metric
.
height
());
const
float
lastCharRight
=
0.0
f
;
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment