From a8681ccaf3d77b62bbc61541911d50aabc37408e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 16 Jun 2009 15:00:30 +0200 Subject: smaller optimisation in ::fromTransform() and fromScale() We know the type of the transformation in these methods, so there is no point in setting a dirty flag for the type. Reviewed-by: Samuel --- src/gui/painting/qtransform.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 7ca3b79..5b498fa 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -438,9 +438,10 @@ QTransform QTransform::fromTranslate(qreal dx, qreal dy) { QTransform transform(1, 0, 0, 0, 1, 0, dx, dy, 1, true); if (dx == 0 && dy == 0) - transform.m_dirty = TxNone; + transform.m_type = TxNone; else - transform.m_dirty = TxTranslate; + transform.m_type = TxTranslate; + transform.m_dirty = TxNone; return transform; } @@ -491,9 +492,10 @@ QTransform QTransform::fromScale(qreal sx, qreal sy) { QTransform transform(sx, 0, 0, 0, sy, 0, 0, 0, 1, true); if (sx == 1. && sy == 1.) - transform.m_dirty = TxNone; + transform.m_type = TxNone; else - transform.m_dirty = TxScale; + transform.m_type = TxScale; + transform.m_dirty = TxNone; return transform; } -- cgit v0.12