summaryrefslogtreecommitdiffstats
path: root/scribus/canvasmode_magnifier.cpp
diff options
context:
space:
mode:
authorjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-01-25 23:35:25 +0000
committerjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-01-25 23:35:25 +0000
commitd1c163aaea3d3eab6959b8668ba0966ce68e79bc (patch)
treee51562f495514138b6305ae1b1381d4aad80069a /scribus/canvasmode_magnifier.cpp
parenta88ef49ae198dbc010b181780f8a5afe043beb7e (diff)
downloadscribus-d1c163aaea3d3eab6959b8668ba0966ce68e79bc.tar.gz
scribus-d1c163aaea3d3eab6959b8668ba0966ce68e79bc.tar.xz
scribus-d1c163aaea3d3eab6959b8668ba0966ce68e79bc.zip
#10540: Zoom tool applies too important zooming factor when drawing box
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17242 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/canvasmode_magnifier.cpp')
-rw-r--r--scribus/canvasmode_magnifier.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/scribus/canvasmode_magnifier.cpp b/scribus/canvasmode_magnifier.cpp
index 462e913..208a669 100644
--- a/scribus/canvasmode_magnifier.cpp
+++ b/scribus/canvasmode_magnifier.cpp
@@ -205,10 +205,9 @@ void CanvasMode_Magnifier::mouseReleaseEvent(QMouseEvent *m)
{
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())
{