r15894 by jghali - #8548 mitigation patch : reduce page redraw problem an object moved with arrow keys triggers a change in doc min coordinates

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 17 22:31:26 CET 2010


Author: jghali
Date: Wed Nov 17 21:31:26 2010
New Revision: 15894

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15894
Log:
#8548 mitigation patch : reduce page redraw problem an object moved with arrow keys triggers a change in doc min coordinates

Modified:
    branches/Version135/Scribus/scribus/canvas.cpp
    branches/Version135/Scribus/scribus/canvas.h

Modified: branches/Version135/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15894&path=/branches/Version135/Scribus/scribus/canvas.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvas.cpp (original)
+++ branches/Version135/Scribus/scribus/canvas.cpp Wed Nov 17 21:31:26 2010
@@ -110,6 +110,7 @@
 	m_bufferRect = QRect();
 	m_viewMode.init();
 	m_renderMode = RENDER_NORMAL;
+	m_oldMinCanvasCoordinate = canvasToLocal(QPointF(0.0, 0.0));
 }
 
 
@@ -586,11 +587,11 @@
 	bool ret = false;
 	QRect viewport(-x(), -y(), m_view->viewport()->width(), m_view->viewport()->height());
 // 	qDebug()<<"Canvas::adjustBuffer"<<viewport<<m_viewMode.forceRedraw<<m_viewMode.operItemSelecting;
-	FPoint minCanvasCoordinate = m_doc->minCanvasCoordinate;
+	QPoint minCanvasCoordinate = canvasToLocal(QPointF(0.0, 0.0));
 	if (minCanvasCoordinate != m_oldMinCanvasCoordinate)
 	{
-		m_bufferRect.translate(qRound((m_oldMinCanvasCoordinate.x() - minCanvasCoordinate.x())*m_viewMode.scale),
-							   qRound((m_oldMinCanvasCoordinate.y() - minCanvasCoordinate.y())*m_viewMode.scale));
+		m_bufferRect.translate(minCanvasCoordinate.x() - m_oldMinCanvasCoordinate.x(),
+							   minCanvasCoordinate.y() - m_oldMinCanvasCoordinate.y());
 		m_oldMinCanvasCoordinate = minCanvasCoordinate;
 	}
 #if DRAW_DEBUG_LINES

Modified: branches/Version135/Scribus/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15894&path=/branches/Version135/Scribus/scribus/canvas.h
==============================================================================
--- branches/Version135/Scribus/scribus/canvas.h (original)
+++ branches/Version135/Scribus/scribus/canvas.h Wed Nov 17 21:31:26 2010
@@ -236,10 +236,10 @@
 	
 	RenderMode m_renderMode;
 	/*QImage*/QPixmap m_buffer;
-	QRect m_bufferRect;
+	QRect   m_bufferRect;
 	QPixmap m_selectionBuffer;
-	QRect m_selectionRect;
-	FPoint m_oldMinCanvasCoordinate;
+	QRect   m_selectionRect;
+	QPoint  m_oldMinCanvasCoordinate;
 };
 
 




More information about the scribus-commit mailing list