r14533 by jghali - #8717: first line of text cannot be centered

scribus-commit scribus-commit at lists.scribus.net
Tue Jan 19 00:45:19 CET 2010


Revision: 14533
Author: jghali
Date: 2010-01-18T09:50:27.405903Z
Commit message: #8717: first line of text cannot be centered

Changeset: 
M  /branches/Version135/Scribus/scribus/pageitem_textframe.cpp

Diffs:
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 14532)
+++ scribus/pageitem_textframe.cpp	(revision 14533)
@@ -491,7 +491,7 @@
 	}
 	
 	/// find x position where this line must end
-	double endOfLine(const QRegion& shape, const QMatrix& pf2, double ascent, double descent, double morespace = 0)
+	double endOfLine(const QRegion& shape, const QMatrix& pf2, double morespace = 0)
 	{
 		// Keep old code for reference
 		/*double EndX = floor(qMax(line.x, qMin(colRight,breakXPos) - 1));
@@ -512,8 +512,8 @@
 
 		double StartX = floor(qMax(line.x, qMin(colRight,breakXPos) - 1));
 		int xPos  = static_cast<int>(ceil(maxX + insets.Right));
-		int yDesc = static_cast<int>(yPos+descent);
-		int yAsc  = static_cast<int>(ceil(yPos-ascent));
+		int yDesc = static_cast<int>(yPos+line.descent);
+		int yAsc  = static_cast<int>(ceil(yPos-line.ascent));
 
 		QPoint pt12 (xPos, yDesc);
 		QPoint pt22 (xPos, yAsc);
@@ -1650,7 +1650,7 @@
 				{
 					// find end of line
 					current.breakLine(itemText, a);
-					EndX = current.endOfLine(cl, pf2, asce, desc, style.rightMargin());
+					EndX = current.endOfLine(cl, pf2, style.rightMargin());
 					current.finishLine(EndX);
 					
 //					if (style.alignment() != 0)
@@ -1717,7 +1717,7 @@
 							hl->glyph.xadvance = 0;
 						}
 						
-						EndX = current.endOfLine(cl, pf2, asce, desc, style.rightMargin());
+						EndX = current.endOfLine(cl, pf2, style.rightMargin());
 						current.finishLine(EndX);
 
 //???						current.breakXPos = current.line.x;
@@ -1800,7 +1800,7 @@
 //						qDebug() << QString("style nb @%6: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
 //							   .arg(style.charStyle().asString()).arg(style.name()).arg(style.parent())
 //							   .arg(a);
-						EndX = current.endOfLine(cl, pf2, asce, desc, style.rightMargin());
+						EndX = current.endOfLine(cl, pf2, style.rightMargin());
 						current.finishLine(EndX);
 //						qDebug() << QString("no break pos: %1-%2 @ %3 wid %4 nat %5 endX %6")
 //							   .arg(current.line.firstItem).arg(current.line.firstItem)
@@ -2123,7 +2123,7 @@
 		int a = itemText.length()-1;
 		hl = a >=0 ? itemText.item(a) : NULL;
 		current.breakLine(itemText, a);
-		EndX = current.endOfLine(cl, pf2, asce, desc, style.rightMargin());
+		EndX = current.endOfLine(cl, pf2, style.rightMargin());
 		current.finishLine(EndX);
 
 //		if (style.alignment() != 0)




More information about the scribus-commit mailing list