r18984 by jghali - #12188: Rotated text cannot be selected

scribus-commit scribus-commit at lists.scribus.net
Thu Apr 3 14:02:59 UTC 2014


Author: jghali
Date: Thu Apr  3 14:02:59 2014
New Revision: 18984

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18984
Log:
#12188: Rotated text cannot be selected

Modified:
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18984&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Thu Apr  3 14:02:59 2014
@@ -1503,26 +1503,25 @@
 	else
 		return false;
 
-
 	if (m_canvas->frameHitTest(canvasPoint, textFrame) == Canvas::INSIDE)
 	{
 		// #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);
-
 		double px = canvasPoint.x() - textFramePoint.x();
 		double py = canvasPoint.y() - textFramePoint.y();
+		FPoint point(px, py);
+		if (mm.isInvertible() && textFrame->itemText.length() > 0)
+		{
+			qreal tx = 0, ty = 0;
+			mm.inverted().map(canvasPoint.x(), canvasPoint.y(), &tx, &ty);
+			point.setXY(tx, ty);
+		}
 		if (textFrame->imageFlippedH())
-			px = textFrame->width() * mm.m11() - px;
+			point.setX(textFrame->width() - point.x());
 		if (textFrame->imageFlippedV())
-			py = textFrame->height() * mm.m22() - py;
-		FPoint point(px, py);
-		point = point.transformPoint(ms, true);
+			point.setY(textFrame->height() - point.y());
 		textFrame->itemText.setCursorPosition(textFrame->itemText.length() == 0 ? 0 :
 			textFrame->itemText.screenToPosition(point));
 




More information about the scribus-commit mailing list