r17242 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:35:25 UTC 2012
Author: jghali
Date: Wed Jan 25 23:35:25 2012
New Revision: 17242
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17242
Log:
#10540: Zoom tool applies too important zooming factor when drawing box
Modified:
branches/Version14x/Scribus/scribus/canvasmode_magnifier.cpp
Modified: branches/Version14x/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17242&path=/branches/Version14x/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/canvasmode_magnifier.cpp (original)
+++ branches/Version14x/Scribus/scribus/canvasmode_magnifier.cpp Wed Jan 25 23:35:25 2012
@@ -205,10 +205,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