summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-30 12:13:11 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-30 13:46:43 (GMT)
commit0fa878c4d2dfc25d4641a6654a9b482230559c3a (patch)
treecb03a353992323252ec4bdab9aa31de6187a7802 /src/opengl
parent0f61a0f1ce02bb0248cb87055240a8a474dce452 (diff)
downloadQt-0fa878c4d2dfc25d4641a6654a9b482230559c3a.zip
Qt-0fa878c4d2dfc25d4641a6654a9b482230559c3a.tar.gz
Qt-0fa878c4d2dfc25d4641a6654a9b482230559c3a.tar.bz2
Fixed square root of negative number in drawTextItem().
Fixed potential bug where you could end up taking the square root of a negative number in drawTextItem() in the raster and OpenGL paint engines. Task-number: QTBUG-6327 Reviewed-by: Trond
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 07432c6..15702ba 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1452,7 +1452,8 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
drawCached = false;
// don't try to cache huge fonts
- if (ti.fontEngine->fontDef.pixelSize * qSqrt(s->matrix.determinant()) >= 64)
+ const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
+ if (pixelSize * pixelSize * qAbs(s->matrix.determinant()) >= 64 * 64)
drawCached = false;
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0