r15044 by fschmid - Fixed Bug #9076: "SVG file crashes Scribus"
scribus-commit
scribus-commit at lists.scribus.net
Tue May 4 23:10:40 CEST 2010
Revision: 15044
Author: fschmid
Date: 2010-05-04T21:05:14.630532Z
Commit message: Fixed Bug #9076: "SVG file crashes Scribus"
Changeset:
M /branches/Version135/Scribus/scribus/pageitem.cpp
Diffs:
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 15043)
+++ scribus/pageitem.cpp (revision 15044)
@@ -5200,7 +5200,6 @@
void PageItem::setPolyClip(int up, int down)
{
- Clip.resize(0);
if (PoLine.size() < 4)
return;
double rot;
@@ -5216,32 +5215,36 @@
QPoint np, np2;
QPolygon cl, cl1, cl2;
cl = FlattenPath(PoLine, Segments);
- for (int a = 0; a < cl.size()-1; ++a)
+ if (cl.size() > 1)
{
- rot = xy2Deg(cl.point(a+1).x()-cl.point(a).x(),cl.point(a+1).y()-cl.point(a).y());
- QMatrix ma;
- ma.rotate(rot);
- np = QPoint(0, -upval) * ma;
- np2 = QPoint(0, -downval) * ma;
+ Clip.resize(0);
+ for (int a = 0; a < cl.size()-1; ++a)
+ {
+ rot = xy2Deg(cl.point(a+1).x()-cl.point(a).x(),cl.point(a+1).y()-cl.point(a).y());
+ QMatrix ma;
+ ma.rotate(rot);
+ np = QPoint(0, -upval) * ma;
+ np2 = QPoint(0, -downval) * ma;
+ cl1.resize(cl1.size()+1);
+ cl1.setPoint(cl1.size()-1, np+cl.point(a));
+ cl1.resize(cl1.size()+1);
+ cl1.setPoint(cl1.size()-1, np+cl.point(a+1));
+ cl2.resize(cl2.size()+1);
+ cl2.setPoint(cl2.size()-1, np2+cl.point(a));
+ cl2.resize(cl2.size()+1);
+ cl2.setPoint(cl2.size()-1, np2+cl.point(a+1));
+ }
cl1.resize(cl1.size()+1);
- cl1.setPoint(cl1.size()-1, np+cl.point(a));
- cl1.resize(cl1.size()+1);
- cl1.setPoint(cl1.size()-1, np+cl.point(a+1));
+ cl1.setPoint(cl1.size()-1, np+cl.point(cl.size()-1));
cl2.resize(cl2.size()+1);
- cl2.setPoint(cl2.size()-1, np2+cl.point(a));
- cl2.resize(cl2.size()+1);
- cl2.setPoint(cl2.size()-1, np2+cl.point(a+1));
+ cl2.setPoint(cl2.size()-1, np2+cl.point(cl.size()-1));
+ Clip.putPoints(Clip.size(), cl1.size(), cl1);
+ for (int a2 = cl2.size()-1; a2 > -1; a2--)
+ {
+ Clip.resize(Clip.size()+1);
+ Clip.setPoint(Clip.size()-1, cl2.point(a2));
+ }
}
- cl1.resize(cl1.size()+1);
- cl1.setPoint(cl1.size()-1, np+cl.point(cl.size()-1));
- cl2.resize(cl2.size()+1);
- cl2.setPoint(cl2.size()-1, np2+cl.point(cl.size()-1));
- Clip.putPoints(Clip.size(), cl1.size(), cl1);
- for (int a2 = cl2.size()-1; a2 > -1; a2--)
- {
- Clip.resize(Clip.size()+1);
- Clip.setPoint(Clip.size()-1, cl2.point(a2));
- }
}
void PageItem::updatePolyClip()
More information about the scribus-commit
mailing list