Skip to content

Commit f829dab

Browse files
committed
More clear norm coord encoding
1 parent 8bd68dc commit f829dab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/gllabel.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ void GLLabel::InsertText(std::u32string text, size_t index, glm::vec4 color, FT_
124124
// This theoretically could overflow, but the atlas position will
125125
// never be over half the size of a uint16, so it's fine.
126126
unsigned int k = (j < 4) ? j : 6 - j;
127-
v[j].data[0] = glyph->bezierAtlasPos[0]*2 + ((k & 1) ? 1 : 0);
128-
v[j].data[1] = glyph->bezierAtlasPos[1]*2 + ((k > 1) ? 1 : 0);
127+
unsigned int norm[2] = { k & 1, k > 1 };
128+
v[j].data[0] = (glyph->bezierAtlasPos[0]<<1) + norm[0];
129+
v[j].data[1] = (glyph->bezierAtlasPos[1]<<1) + norm[1];
129130
this->verts[(index + i)*6 + j] = v[j];
130131
}
131132

0 commit comments

Comments
 (0)