r25048 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Sat Mar 19 14:14:03 UTC 2022
Author: jghali
Date: Sat Mar 19 14:14:03 2022
New Revision: 25048
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25048
Log:
Code cleanup
Modified:
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/scribusview.h
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25048&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Mar 19 14:14:03 2022
@@ -3275,24 +3275,24 @@
setViewportMargins(newTopLeftMargin, newTopLeftMargin, 0, 0);
}
-void ScribusView::setScale(const double newScale)
-{
- double Scale=newScale;
- double v=m_doc->opToolPrefs().magMin*Prefs->displayPrefs.displayScale/100.0;
- if (Scale < v)
- Scale=v;
- double v2=m_doc->opToolPrefs().magMax*Prefs->displayPrefs.displayScale/100.0;
- if (Scale > v2)
- Scale=v2;
- double v3=320*Prefs->displayPrefs.displayScale;
- if (Scale > v3)
- Scale=v3;
-
- m_canvas->setScale(Scale);
-
- m_ScMW->zoomSpinBox->blockSignals(true);
- m_ScMW->zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
- m_ScMW->zoomSpinBox->blockSignals(false);
+void ScribusView::setScale(double newScale)
+{
+ double canvasScale = newScale;
+ double v = m_doc->opToolPrefs().magMin*Prefs->displayPrefs.displayScale / 100.0;
+ if (canvasScale < v)
+ canvasScale = v;
+ double v2 = m_doc->opToolPrefs().magMax*Prefs->displayPrefs.displayScale / 100.0;
+ if (canvasScale > v2)
+ canvasScale = v2;
+ double v3 = 320 * Prefs->displayPrefs.displayScale;
+ if (canvasScale > v3)
+ canvasScale = v3;
+
+ m_canvas->setScale(canvasScale);
+
+ bool sigBlocked = m_ScMW->zoomSpinBox->blockSignals(true);
+ m_ScMW->zoomSpinBox->setValue(m_canvas->scale() / Prefs->displayPrefs.displayScale * 100.0);
+ m_ScMW->zoomSpinBox->blockSignals(sigBlocked);
unitChange();
}
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25048&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sat Mar 19 14:14:03 2022
@@ -198,7 +198,7 @@
Selection* customSelection = 0);
void endGroupTransaction();
void cancelGroupTransaction();
- void setScale(const double newScale);
+ void setScale(double newScale);
double scale() const;
void changed(QRectF re, bool) override;
More information about the scribus-commit
mailing list