r18696 by jghali - #11909, #11915: Editing flipped text frames from canvas behave as no flipped ones

scribus-commit scribus-commit at lists.scribus.net
Tue Jan 7 20:39:55 UTC 2014


Author: jghali
Date: Tue Jan  7 20:39:55 2014
New Revision: 18696

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18696
Log:
#11909, #11915: Editing flipped text frames from canvas behave as no flipped ones

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18696&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Tue Jan  7 20:39:55 2014
@@ -1093,9 +1093,12 @@
 		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.charStyle ( textCursorPos ).fillColor() ], m_doc ) );
 	}
 	//handle Right to Left writing
-	if ( textframe->reversed() )
-	{
-		dx=textframe->width()-dx;
+	if (textframe->imageFlippedH())
+		dx = textframe->width() - dx;
+	if (textframe->imageFlippedV())
+	{
+		dy  = textframe->height() - dy;
+		dy1 = textframe->height() - dy1;
 	}
 	p->save();
 	p->setTransform(textframe->getTransform(), true);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18696&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Tue Jan  7 20:39:55 2014
@@ -1682,24 +1682,22 @@
 		// #9592 : layout must be valid here, or screenToPosition() may crash
 		if (textFrame->invalid)
 			textFrame->layout();
+
 		double sx, sy;
 		getScaleFromMatrix(mm, sx, sy);
 		QTransform ms;
 		ms.scale(sx, sy);
-		if(textFrame->reversed())
-		{ //handle Right to Left writing
-			FPoint point(textFrame->width() * mm.m11() - (canvasPoint.x() - textFramePoint.x()), canvasPoint.y() - textFramePoint.y());
-			point = point.transformPoint(ms, true);
-			textFrame->itemText.setCursorPosition(textFrame->itemText.length() == 0 ? 0 :
-				textFrame->itemText.screenToPosition(point));
-		}
-		else
-		{
-			FPoint point(canvasPoint.x() - textFramePoint.x(), canvasPoint.y() - textFramePoint.y());
-			point = point.transformPoint(ms, true);
-			textFrame->itemText.setCursorPosition(textFrame->itemText.length() == 0 ? 0 :
-				textFrame->itemText.screenToPosition(point));
-		}
+
+		double px = canvasPoint.x() - textFramePoint.x();
+		double py = canvasPoint.y() - textFramePoint.y();
+		if (textFrame->imageFlippedH())
+			px = textFrame->width() * mm.m11() - px;
+		if (textFrame->imageFlippedV())
+			py = textFrame->height() * mm.m22() - py;
+		FPoint point(px, py);
+		point = point.transformPoint(ms, true);
+		textFrame->itemText.setCursorPosition(textFrame->itemText.length() == 0 ? 0 :
+			textFrame->itemText.screenToPosition(point));
 
 		if (textFrame->itemText.length() > 0)
 		{




More information about the scribus-commit mailing list