r25049 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Sat Mar 19 14:14:35 UTC 2022
Author: jghali
Date: Sat Mar 19 14:14:35 2022
New Revision: 25049
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25049
Log:
Code cleanup
Modified:
branches/Version15x/Scribus/scribus/scribusview.cpp
branches/Version15x/Scribus/scribus/scribusview.h
Modified: branches/Version15x/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25049&path=/branches/Version15x/Scribus/scribus/scribusview.cpp
==============================================================================
--- branches/Version15x/Scribus/scribus/scribusview.cpp (original)
+++ branches/Version15x/Scribus/scribus/scribusview.cpp Sat Mar 19 14:14:35 2022
@@ -3270,29 +3270,27 @@
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);
+ m_ScMW->zoomSpinBox->blockSignals(sigBlocked);
unitChange();
}
-
-
double ScribusView::scale() const
{
Modified: branches/Version15x/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25049&path=/branches/Version15x/Scribus/scribus/scribusview.h
==============================================================================
--- branches/Version15x/Scribus/scribus/scribusview.h (original)
+++ branches/Version15x/Scribus/scribus/scribusview.h Sat Mar 19 14:14:35 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