r17243 by jghali - #10540: Zoom tool applies too important zooming factor when drawing box

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 25 23:36:00 UTC 2012


Author: jghali
Date: Wed Jan 25 23:35:59 2012
New Revision: 17243

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17243
Log:
#10540: Zoom tool applies too important zooming factor when drawing box

Modified:
    trunk/Scribus/scribus/canvasmode_magnifier.cpp

Modified: trunk/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17243&path=/trunk/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.cpp Wed Jan 25 23:35:59 2012
@@ -204,10 +204,9 @@
 		{
 			QRect geom = m_view->redrawMarker->geometry().normalized();
 			FPoint nx = m_canvas->globalToCanvas(QPoint(geom.x() + geom.width() / 2, geom.y() + geom.height() / 2));
-			double scaleAdjust = m_view->visibleWidth() / static_cast<double>(qMax(geom.width(), 1));
-			/*m_view->setScale(m_canvas->scale() * scaleAdjust);
-			m_view->slotDoZoom();
-			m_view->SetCCPo(nx.x(), nx.y());*/
+			double scaleH = m_view->visibleWidth() / static_cast<double>(qMax(geom.width(), 1));
+			double scaleV = m_view->visibleHeight() / static_cast<double>(qMax(geom.height(), 1));
+			double scaleAdjust = qMax(0.5, qMin(scaleH, scaleV));
 			m_view->zoom(nx.x(), nx.y(), m_canvas->scale() * scaleAdjust, false);
 			if (sc == m_canvas->scale())
 			{




More information about the scribus-commit mailing list