r14443 by jghali - #8642 (3rd round v2): Inconsistent use of gWidth versus Width when laying out lines with inline frames Do some little simplification of the code now that glyph xadvance is set appropriately by PageItem_TextFrame::layout()

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 21 01:05:19 CET 2009


Revision: 14443
Author: jghali
Date: 2009-12-20T12:19:26.704894Z
Commit message: #8642 (3rd round v2): Inconsistent use of gWidth versus Width when laying out lines with inline frames
Do some little simplification of the code now that glyph xadvance is set appropriately by PageItem_TextFrame::layout()

Changeset: 
M  /trunk/Scribus/scribus/scpageoutput.cpp

Diffs:
Index: scribus/scpageoutput.cpp
===================================================================
--- scribus/scpageoutput.cpp	(revision 14442)
+++ scribus/scpageoutput.cpp	(revision 14443)
@@ -1088,10 +1088,11 @@
 		hl->glyph.yadvance = 0;
 		item->layoutGlyphs(itemText.charStyle(a), chstr, hl->glyph);
 		hl->glyph.shrink();                                                           // HACK
-		if (hl->ch == SpecialChars::OBJECT)
+		// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
+		/*if (hl->ch == SpecialChars::OBJECT)
 			dx = (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth()) * hl->glyph.scaleH / 2.0;
-		else
-			dx = hl->glyph.wide() / 2.0;
+		else*/
+		dx = hl->glyph.wide() / 2.0;
 
 		CurX += dx;
 
@@ -1398,10 +1399,11 @@
 							drawGlyphs(item, painter, charStyle, hl->glyph, clip);
 						painter->restore();
 					}
-					if (hl->ch == SpecialChars::OBJECT)
+					// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
+					/*if (hl->ch == SpecialChars::OBJECT)
 						CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth());
-					else
-						CurX += hl->glyph.wide();
+					else*/
+					CurX += hl->glyph.wide();
 				}
 				tabDist = CurX;
 			}




More information about the scribus-commit mailing list