r20616 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 8 12:11:25 UTC 2015


Author: jghali
Date: Tue Dec  8 12:11:25 2015
New Revision: 20616

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20616
Log:
#13470: missing Layout Update/Display Refresh for Text boxes using certain 'align and distribute' buttons
#8548: redrawing the canvas goes wrong when object moved with arrow keys forcing the canvas to scroll

Modified:
    branches/Version14x/Scribus/scribus/canvas.cpp

Modified: branches/Version14x/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20616&path=/branches/Version14x/Scribus/scribus/canvas.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/canvas.cpp	(original)
+++ branches/Version14x/Scribus/scribus/canvas.cpp	Tue Dec  8 12:11:25 2015
@@ -625,29 +625,6 @@
 			newRect.translate(0, viewport.bottom() - m_bufferRect.bottom());
 //		qDebug() << "adjust buffer: " << m_bufferRect << "outside viewport" << viewport << " new rect:" << newRect;
 		
-/*
-		// enlarge buffer by half a screenwidth:
-		QRect newRect(m_bufferRect);
-		if (m_bufferRect.left() > viewport.left())
-			newRect.setLeft(qMin(newRect.left() - viewport.width()/2, viewport.left()));
-		if (m_bufferRect.right() < viewport.right())
-			newRect.setRight(qMax(newRect.right() + viewport.width()/2, viewport.right()));
-		if (m_bufferRect.top() > viewport.top())
-			newRect.setTop(qMin(newRect.top() - viewport.height()/2, viewport.top()));
-		if (m_bufferRect.bottom() < viewport.bottom())
-			newRect.setBottom(qMax(newRect.bottom() + viewport.height()/2, viewport.bottom()));
-		// if too large, try something smaller:
-		if (newRect.width() > 2*viewport.width())
-		{
-			newRect.setLeft(qMax(viewport.left() - viewport.width()/2, newRect.left()));
-			newRect.setRight(qMin(viewport.right() + viewport.width()/2, newRect.right()));
-		}
-		if (newRect.height() > 2*viewport.height())
-		{
-			newRect.setTop(qMax(viewport.top() - viewport.height()/2, newRect.top()));
-			newRect.setBottom(qMin(viewport.bottom() + viewport.height()/2, newRect.bottom()));
-		}
-*/
 		if (!m_bufferRect.intersects(newRect))
 		{
 //			qDebug() << "adjust buffer: fresh buffer" << m_bufferRect << "-->" << newRect;
@@ -707,25 +684,29 @@
 //			qDebug() << "adjust buffer old" << m_bufferRect << "@" << xpos << ypos << "--> new" << newRect;
 #endif
 			p.end();
+
+			// #8548, #13470 do not return true in this case, we only partially update buffer content
+			// and the redraw rect from paintEvent may not be included in the updated area if
+			// canvas has just been resized, after an object has been put in scrap area for eg.
 			if (newRect.top() < m_bufferRect.top())
 			{
 				fillBuffer(&newBuffer, newRect.topLeft(), QRect(newRect.left(), newRect.top(), newRect.width(), m_bufferRect.top() - newRect.top() + 2));
-				ret = true;
+				//ret = true;
 			}
 			if (newRect.bottom() > m_bufferRect.bottom())
 			{
 				fillBuffer(&newBuffer, newRect.topLeft(), QRect(newRect.left(), m_bufferRect.bottom() - 1, newRect.width(), newRect.bottom() - m_bufferRect.bottom() + 2));
-				ret = true;
+				//ret = true;
 			}
 			if (newRect.left() < m_bufferRect.left())
 			{
 				fillBuffer(&newBuffer, newRect.topLeft(), QRect(newRect.left(), m_bufferRect.top(), m_bufferRect.left() - newRect.left() + 2, m_bufferRect.height()));
-				ret = true;
+				//ret = true;
 			}
 			if (newRect.right() > m_bufferRect.right())
 			{
 				fillBuffer(&newBuffer, newRect.topLeft(), QRect(m_bufferRect.right() - 1, m_bufferRect.top(), newRect.right() - m_bufferRect.right() + 2, m_bufferRect.height()));
-				ret = true;
+				//ret = true;
 			}
 			m_buffer = newBuffer;
 			m_bufferRect = newRect;




More information about the scribus-commit mailing list