summaryrefslogtreecommitdiff
path: root/src/gui/painting
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-30 13:13:11 +0100
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-11-30 14:46:43 +0100
commit0fa878c4d2dfc25d4641a6654a9b482230559c3a (patch)
treecb03a353992323252ec4bdab9aa31de6187a7802 /src/gui/painting
parent0f61a0f1ce02bb0248cb87055240a8a474dce452 (diff)
downloadqt4-tools-0fa878c4d2dfc25d4641a6654a9b482230559c3a.tar.gz
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/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 3f33319f1c..4a7243447f 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3240,7 +3240,8 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
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;
// ### Remove the TestFontEngine and Box engine crap, in these