[yast-commit] r55386 - /trunk/qt-graph/src/QY2Graph.cc
Author: aschnell Date: Tue Feb 10 13:20:26 2009 New Revision: 55386 URL: http://svn.opensuse.org/viewcvs/yast?rev=55386&view=rev Log: - use determinant for scale factor calculation since it is invariant to rotations Modified: trunk/qt-graph/src/QY2Graph.cc Modified: trunk/qt-graph/src/QY2Graph.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/QY2Graph.cc?rev=55386&r1=55385&r2=55386&view=diff ============================================================================== --- trunk/qt-graph/src/QY2Graph.cc (original) +++ trunk/qt-graph/src/QY2Graph.cc Tue Feb 10 13:20:26 2009 @@ -96,9 +96,12 @@ void QY2Graph::scaleView(qreal scaleFactor) { - qreal factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); - if (factor < 0.05 || factor > 10) - return; + qreal f = sqrt(matrix().det()); + + if (scaleFactor * f > 8.0) + scaleFactor = 8.0 / f; + if (scaleFactor * f < 0.1) + scaleFactor = 0.1 / f; scale(scaleFactor, scaleFactor); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org