r18499 by craig - Add setForcedRedraw() to canvas and use it, and setPreviewMode

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 24 22:02:54 UTC 2013


Author: craig
Date: Tue Sep 24 22:02:54 2013
New Revision: 18499

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18499
Log:
Add setForcedRedraw() to canvas and use it, and setPreviewMode

Modified:
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18499&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Tue Sep 24 22:02:54 2013
@@ -189,6 +189,7 @@
 		m_viewMode.redrawPolygon.clear();
 		return m_viewMode.redrawPolygon;
 	}
+	void setForcedRedraw(bool on) { m_viewMode.forceRedraw = on; }
 	void setPreviewMode(bool on) { m_viewMode.previewMode = on; }
 	bool isPreviewMode() const { return m_viewMode.previewMode || m_viewMode.viewAsPreview; }
 	bool usePreviewVisual() const { return m_viewMode.viewAsPreview && m_viewMode.previewVisual != 0; }

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18499&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Sep 24 22:02:54 2013
@@ -540,7 +540,7 @@
 	if (!Doc->isLoading() && !m_ScMW->scriptIsRunning())
 	{
 // 		qDebug() << "ScribusView-changed(): changed region:" << re;
-		m_canvas->m_viewMode.forceRedraw = true;
+		m_canvas->setForcedRedraw(true);
 		updateCanvas(re);
 	}
 }
@@ -586,7 +586,7 @@
 		m_canvasMode->activate(true);
 		if (PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
 		{
-			m_canvas->m_viewMode.forceRedraw = true;
+			m_canvas->setForcedRedraw(true);
 //			Doc->m_Selection->clear();
 //			emit HaveSel(-1);
 			m_canvas->resetRenderMode();
@@ -2094,7 +2094,7 @@
 		clockLabel->setFixedSize(15, 15);
 	}
 	endEditButton->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - endEditButton->minimumSizeHint().height() - 1, endEditButton->minimumSizeHint().width(), endEditButton->minimumSizeHint().height());
-	m_canvas->m_viewMode.forceRedraw = true;
+	m_canvas->setForcedRedraw(true);
 	m_canvas->resetRenderMode();
 	// Per Qt doc, not painting should be done in a resizeEvent,
 	// a paint event will be emitted right afterwards
@@ -2599,7 +2599,7 @@
 // 	printBacktrace(24);
 	if (m_ScMW->scriptIsRunning())
 		return;
-	m_canvas->m_viewMode.forceRedraw = true;
+	m_canvas->setForcedRedraw(true);
 	m_canvas->resetRenderMode();
 	updateContents();
 	setRulerPos(contentsX(), contentsY());
@@ -2820,8 +2820,8 @@
 		Doc->guidesPrefs().showControls = false;
 		Doc->guidesPrefs().framesShown = false;
 		setScale(1.0);
-		m_canvas->m_viewMode.previewMode = true;
-		m_canvas->m_viewMode.forceRedraw = true;
+		m_canvas->setPreviewMode(true);
+		m_canvas->setForcedRedraw(true);
 		pm = QImage(clipw, cliph, QImage::Format_ARGB32_Premultiplied);
 		ScPainter *painter = new ScPainter(&pm, pm.width(), pm.height(), 1.0, 0);
 		painter->clear(Doc->paperColor());
@@ -2851,8 +2851,8 @@
 			im = pm.scaled(static_cast<int>(pm.width() / sy), static_cast<int>(pm.height() / sy), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
 		delete painter;
 		painter=NULL;
-		m_canvas->m_viewMode.previewMode = false;
-		m_canvas->m_viewMode.forceRedraw = false;
+		m_canvas->setPreviewMode(false);
+		m_canvas->setForcedRedraw(false);
 		Doc->guidesPrefs().framesShown = frs;
 		Doc->guidesPrefs().showControls = ctrls;
 		setScale(sca);
@@ -2889,8 +2889,8 @@
 			Doc->guidesPrefs().showControls = false;
 			Doc->drawAsPreview = true;
 			m_canvas->setScale(sc);
-			m_canvas->m_viewMode.previewMode = true;
-			m_canvas->m_viewMode.forceRedraw = true;
+			m_canvas->setPreviewMode(true);
+			m_canvas->setForcedRedraw(true);
 			ScPage* act = Doc->currentPage();
 			bool mMode = Doc->masterPageMode();
 			Doc->setMasterPageMode(false);
@@ -3004,8 +3004,8 @@
 			Doc->setMasterPageMode(mMode);
 			Doc->setCurrentPage(act);
 			Doc->setLoading(false);
-			m_canvas->m_viewMode.previewMode = Doc->drawAsPreview;
-			m_canvas->m_viewMode.forceRedraw = false;
+			m_canvas->setPreviewMode(Doc->drawAsPreview);
+			m_canvas->setForcedRedraw(false);
 			Doc->minCanvasCoordinate = FPoint(cx, cy);
 		}
 	}




More information about the scribus-commit mailing list