r16737 by jghali - better behavior of text cursor for rotated text frames
scribus-commit
scribus-commit at lists.scribus.net
Sun Jul 31 00:31:42 UTC 2011
Author: jghali
Date: Sun Jul 31 00:31:41 2011
New Revision: 16737
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16737
Log:
better behavior of text cursor for rotated text frames
Modified:
branches/Version135/Scribus/scribus/scribusview.cpp
Modified: branches/Version135/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16737&path=/branches/Version135/Scribus/scribus/scribusview.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusview.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusview.cpp Sun Jul 31 00:31:41 2011
@@ -1704,18 +1704,19 @@
// #9592 : layout must be valid here, or screenToPosition() may crash
if (currItem->invalid)
currItem->layout();
- if(currItem->reversed())
- { //handle Right to Left writing
- FPoint point(currItem->width()-(pf.x() - currItem->xPos()), pf.y() - currItem->yPos());
- currItem->itemText.setCursorPosition( currItem->itemText.length() == 0 ? 0 :
- currItem->itemText.screenToPosition(point) );
+
+ QMatrix transform = currItem->getTransform();
+ FPoint point(pf.x() - currItem->xPos(), pf.y() - currItem->yPos());
+ if (transform.isInvertible() && currItem->itemText.length() > 0)
+ {
+ double tx = 0, ty = 0;
+ transform.inverted().map(pf.x(), pf.y(), &tx, &ty);
+ point.setXY(tx, ty);
}
- else
- {
- FPoint point(pf.x() - currItem->xPos(), pf.y() - currItem->yPos());
- currItem->itemText.setCursorPosition( currItem->itemText.length() == 0 ? 0 :
- currItem->itemText.screenToPosition(point) );
- }
+ if (currItem->reversed())
+ point.setX(currItem->width() - point.x());
+ currItem->itemText.setCursorPosition( currItem->itemText.length() == 0 ? 0 :
+ currItem->itemText.screenToPosition(point) );
if (currItem->itemText.length() > 0)
{
More information about the scribus-commit
mailing list