Skip to content

Commit

Permalink
Update too many curves check for new bezier limits
Browse files Browse the repository at this point in the history
  • Loading branch information
azsn committed Oct 11, 2020
1 parent 98885f4 commit cc1d694
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gllabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,10 @@ GLFontManager::Glyph * GLFontManager::GetGlyphForCodepoint(FT_Face face, uint32_
// Plus two pixels for grid position information
uint16_t bezierPixelLength = 2 + curves.size()*3;

if (curves.size() == 0 || bezierPixelLength > kBezierAtlasSize) {
if (bezierPixelLength > kBezierAtlasSize) {
bool tooManyCurves = uint32_t(bezierPixelLength) > sq(uint32_t(kBezierAtlasSize));

if (curves.size() == 0 || tooManyCurves) {
if (tooManyCurves) {
std::cerr << "WARN: Glyph " << point << " has too many curves\n";
}

Expand Down

0 comments on commit cc1d694

Please sign in to comment.