r16921 by jghali - easy speedup for LineControl::endOfLine()
scribus-commit
scribus-commit at lists.scribus.net
Sat Oct 22 13:14:17 UTC 2011
Author: jghali
Date: Sat Oct 22 13:14:16 2011
New Revision: 16921
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16921
Log:
easy speedup for LineControl::endOfLine()
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16921&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sat Oct 22 13:14:16 2011
@@ -502,23 +502,24 @@
double StartX = floor(qMax(line.x, qMin(maxX,breakXPos-maxShrink-1))-1);
int xPos = static_cast<int>(ceil(maxX));
- QPoint pt12 (xPos, Yasc);
- QPoint pt22 (xPos, Ydesc);
- QRect pt(pt12,pt22);
+ QPoint pt12 (xPos, Yasc);
+ QPoint pt22 (xPos, Ydesc);
+ QRect pt(pt12,pt22);
+ QRegion region;
double EndX2 = StartX;
double Interval = 0.25;
do {
int xP = static_cast<int>(ceil(EndX2 + morespace));
pt.moveTopLeft(QPoint(xP, Yasc));
- if (!QRegion(pf2.mapToPolygon(pt)).subtracted(shape).isEmpty())
+ region = QRegion(pf2.mapToPolygon(pt)).subtracted(shape);
+ if (!region.isEmpty())
break;
EndX2 += Interval;
- } while ((EndX2 < maxX) && QRegion(pf2.mapToPolygon(pt)).subtracted(shape).isEmpty());
+ } while ((EndX2 < maxX) && region.isEmpty());
return qMin(EndX2, maxX);
}
-
double getLineAscent(const StoryText& itemText)
{
More information about the scribus-commit
mailing list