summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-07 04:03:14 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-07 04:03:14 (GMT)
commitdd9376a096fa4e50cb5c192fc66c749e0e60a467 (patch)
treeb8db380db6670c6bb4139c496695bbcd07c459e3 /src/gui/painting/qtextureglyphcache.cpp
parentc380aeefbfa2cd1aa2d1d21f45101bfb058a40de (diff)
parentd4e0060d3e8961f0c802289dd6eebf9688be2fc7 (diff)
downloadQt-dd9376a096fa4e50cb5c192fc66c749e0e60a467.zip
Qt-dd9376a096fa4e50cb5c192fc66c749e0e60a467.tar.gz
Qt-dd9376a096fa4e50cb5c192fc66c749e0e60a467.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index cf545be..9eda0ef 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -133,10 +133,13 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
while (iter != listItemCoordinates.end()) {
Coord c = iter.value();
+ m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
+
if (m_cx + c.w > m_w) {
// no room on the current line, start new glyph strip
m_cx = 0;
- m_cy += rowHeight;
+ m_cy += m_currentRowHeight;
+ m_currentRowHeight = 0; // New row
}
if (m_cy + c.h > m_h) {
int new_height = m_h*2;
@@ -153,14 +156,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
fillTexture(c, iter.key());
coords.insert(iter.key(), c);
- if (m_cx + c.w > m_w) {
- m_cx = 0;
- m_cy += rowHeight;
- } else {
- // for the Mono case, glyph_width is 8-bit aligned,
- // and therefore so will m_cx
- m_cx += c.w;
- }
+ m_cx += c.w;
++iter;
}