r18280 by jghali - #11520: Convert Text to Outlines disrupts text position if modified

scribus-commit scribus-commit at lists.scribus.net
Sun May 5 13:52:54 UTC 2013


Author: jghali
Date: Sun May  5 13:52:54 2013
New Revision: 18280

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18280
Log:
#11520: Convert Text to Outlines disrupts text position if modified

Modified:
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18280&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sun May  5 13:52:54 2013
@@ -3831,8 +3831,8 @@
 							QTransform chma, chma6;
 							uint gl = hl->font().char2CMap(chr);
 							FPoint origin = hl->font().glyphOrigin(gl);
-							x = origin.x() * csi;
-							y = origin.y() * csi;
+							x = origin.x() * csi * hl->glyph.scaleH;
+							y = origin.y() * csi * hl->glyph.scaleV;
 							if ((charStyle.effects() & ScStyle_Underline) || ((charStyle.effects() & ScStyle_UnderlineWords)  && chstr.toUInt() != charStyle.font().char2CMap(QChar(' '))))
 							{
 								double st, lw;
@@ -3883,7 +3883,7 @@
 								else
 									wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 								if (currItem->imageFlippedH())
-									textX = currItem->width() - textX - wide;
+									textX = currItem->width() - textX - bb->width() - x;
 								if (currItem->imageFlippedV())
 									textY = currItem->height() - textY + y - (bb->height() - y);
 								FPoint npo(textX, textY, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -3939,11 +3939,7 @@
 									double textX = CurX + hl->glyph.xoffset;
 									double textY = ls.y;  // + hl->glyph.yoffset;
 									if (charStyle.effects() & (ScStyle_Subscript | ScStyle_Superscript))
-									{
 										textY += hl->glyph.yoffset;
-										x *= hl->glyph.scaleH;
-										y *= hl->glyph.scaleV;
-									}
 									chma6 = QTransform();
 									if (charStyle.baselineOffset() != 0)
 										textY -= (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -3952,7 +3948,7 @@
 									else
 										wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 									if (currItem->imageFlippedH())
-										textX = currItem->width() - textX - wide;
+										textX = currItem->width() - textX - bb->width() - x;
 									if (currItem->imageFlippedV())
 										textY = currItem->height() - textY + y - (bb->height() - y);
 									FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -3998,11 +3994,7 @@
 								double textX = CurX + hl->glyph.xoffset;
 								double textY = ls.y;  // + hl->glyph.yoffset;
 								if (charStyle.effects() & (ScStyle_Subscript | ScStyle_Superscript))
-								{
 									textY += hl->glyph.yoffset;
-									x *= hl->glyph.scaleH;
-									y *= hl->glyph.scaleV;
-								}
 								chma6 = QTransform();
 								if (charStyle.baselineOffset() != 0)
 									textY -= (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -4011,7 +4003,7 @@
 								else
 									wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 								if (currItem->imageFlippedH())
-									textX = currItem->width() - textX - wide;
+									textX = currItem->width() - textX - bb->width() - x;
 								if (currItem->imageFlippedV())
 									textY = currItem->height() - textY + y - (bb->height() - y);
 								FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -4073,7 +4065,7 @@
 								else
 									wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 								if (currItem->imageFlippedH())
-									textX = currItem->width() - textX - wide;
+									textX = currItem->width() - textX - bb->width() - x;
 								if (currItem->imageFlippedV())
 									textY = currItem->height() - textY + y - (bb->height() - y);
 								FPoint npo(textX, textY, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);




More information about the scribus-commit mailing list