summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/distancefieldgenerator/mainwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/distancefieldgenerator/mainwindow.cpp b/src/distancefieldgenerator/mainwindow.cpp
index 94f5c8ebb..3717330b4 100644
--- a/src/distancefieldgenerator/mainwindow.cpp
+++ b/src/distancefieldgenerator/mainwindow.cpp
@@ -488,14 +488,14 @@ QByteArray MainWindow::createSfntTable()
break;
glyphData.textureIndex = rect.y() / textureSize;
- if (glyphData.textureIndex >= allocatedAreaPerTexture.size())
- allocatedAreaPerTexture.resize(glyphData.textureIndex + 1);
+ while (glyphData.textureIndex >= allocatedAreaPerTexture.size())
+ allocatedAreaPerTexture.append(QRect(0, 0, 1, 1));
+
allocatedAreaPerTexture[glyphData.textureIndex] |= QRect(rect.x(),
rect.y() % textureSize,
rect.width(),
rect.height());
-
glyphData.texCoord.xMargin = QT_DISTANCEFIELD_RADIUS(m_model->doubleGlyphResolution()) / qreal(QT_DISTANCEFIELD_SCALE(m_model->doubleGlyphResolution()));
glyphData.texCoord.yMargin = QT_DISTANCEFIELD_RADIUS(m_model->doubleGlyphResolution()) / qreal(QT_DISTANCEFIELD_SCALE(m_model->doubleGlyphResolution()));
glyphData.texCoord.x = rect.x() + padding;