Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16762 → Rev 16763

/trunk/Scribus/scribus/pdflib_core.cpp
5760,24 → 5760,28
QString PDFLibCore::SetClipPath(PageItem *ite, bool poly)
{
QString tmp("");
FPoint np, np1, np2, np3, np4, firstP;
bool nPath = true;
bool first = true;
if (ite->PoLine.size() > 3)
{
bool nPath = true;
for (uint poi=0; poi<ite->PoLine.size()-3; poi += 4)
{
if (ite->PoLine.point(poi).x() > 900000)
{
if (poly)
tmp += "h\n";
nPath = true;
continue;
}
FPoint np, np1, np2, np3;
if (nPath)
{
np = ite->PoLine.point(poi);
if ((!first) && (poly) && (np4 == firstP))
tmp += "h\n";
tmp += FToStr(np.x())+" "+FToStr(-np.y())+" m\n";
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = ite->PoLine.point(poi);
np1 = ite->PoLine.point(poi+1);
5791,6 → 5795,7
tmp += FToStr(np2.x())+" "+FToStr(-np2.y())+" ";
tmp += FToStr(np3.x())+" "+FToStr(-np3.y())+" c\n";
}
np4 = np3;
}
}
return tmp;
5799,24 → 5804,28
QString PDFLibCore::SetClipPathArray(FPointArray *ite, bool poly)
{
QString tmp("");
FPoint np, np1, np2, np3, np4, firstP;
bool nPath = true;
bool first = true;
if (ite->size() > 3)
{
bool nPath = true;
for (uint poi=0; poi<ite->size()-3; poi += 4)
{
if (ite->point(poi).x() > 900000)
{
if (poly)
tmp += "h\n";
nPath = true;
continue;
}
FPoint np, np1, np2, np3;
if (nPath)
{
np = ite->point(poi);
if ((!first) && (poly) && (np4 == firstP))
tmp += "h\n";
tmp += FToStr(np.x())+" "+FToStr(-np.y())+" m\n";
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = ite->point(poi);
np1 = ite->point(poi+1);
5830,6 → 5839,7
tmp += FToStr(np2.x())+" "+FToStr(-np2.y())+" ";
tmp += FToStr(np3.x())+" "+FToStr(-np3.y())+" c\n";
}
np4 = np3;
}
}
return tmp;
/trunk/Scribus/scribus/fpointarray.cpp
472,7 → 472,7
QString FPointArray::svgPath(bool closed) const
{
QString tmp = "";
FPoint np, np1, np2, np3;
FPoint np, np1, np2, np3, np4, firstP;
bool nPath = true;
bool first = true;
if (size() > 3)
481,7 → 481,6
{
if (point(poi).x() > 900000)
{
// tmp += "Z ";
nPath = true;
continue;
}
488,11 → 487,13
if (nPath)
{
np = point(poi);
if ((!first) && (closed))
if ((!first) && (closed) && (np4 == firstP))
tmp += "Z ";
tmp += "M"+QString::number(np.x())+" "+QString::number(np.y())+" ";
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = point(poi);
np1 = point(poi+1);
502,6 → 503,7
tmp += QString("L%1 %2 ").arg(np3.x()).arg(np3.y());
else
tmp += QString("C%1 %2 %3 %4 %5 %6 ").arg(np1.x()).arg(np1.y()).arg(np2.x()).arg(np2.y()).arg(np3.x()).arg(np3.y());
np4 = np3;
}
if (closed)
tmp += "Z";
514,7 → 516,7
QPainterPath m_path = QPainterPath();
bool nPath = true;
bool first = true;
FPoint np, np1, np2, np3;
FPoint np, np1, np2, np3, np4, firstP;
if (size() > 3)
{
for (uint poi = 0; poi < size()-3; poi += 4)
527,11 → 529,13
if (nPath)
{
np = point(poi);
if ((!first) && (closed))
if ((!first) && (closed) && (np4 == firstP))
m_path.closeSubpath();
m_path.moveTo(np.x(), np.y());
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = point(poi);
np1 = point(poi+1);
541,6 → 545,7
m_path.lineTo(np3.x(), np3.y());
else
m_path.cubicTo(np1.x(), np1.y(), np2.x(), np2.y(), np3.x(), np3.y());
np4 = np3;
}
if (closed)
m_path.closeSubpath();
/trunk/Scribus/scribus/scpainter.cpp
1798,7 → 1798,7
{
bool nPath = true;
bool first = true;
FPoint np, np1, np2, np3, np4;
FPoint np, np1, np2, np3, np4, firstP;
if (points->size() > 3)
{
newPath();
1812,9 → 1812,10
if (nPath)
{
np = points->point(poi);
if ((!first) && (closed))
if ((!first) && (closed) && (np4 == firstP))
cairo_close_path( m_cr );
cairo_move_to( m_cr, np.x(), np.y());
firstP = np;
nPath = false;
first = false;
np4 = np;
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
2176,8 → 2176,9
QString SVGExPlug::SetClipPath(FPointArray *ite, bool closed)
{
QString tmp = "";
FPoint np, np1, np2, np3;
FPoint np, np1, np2, np3, np4, firstP;
bool nPath = true;
bool first = true;
if (ite->size() > 3)
{
for (uint poi=0; poi<ite->size()-3; poi += 4)
2184,7 → 2185,6
{
if (ite->point(poi).x() > 900000)
{
tmp += "Z ";
nPath = true;
continue;
}
2191,8 → 2191,13
if (nPath)
{
np = ite->point(poi);
if ((!first) && (closed) && (np4 == firstP))
tmp += "Z ";
tmp += QString("M%1 %2 ").arg(np.x()).arg(np.y());
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = ite->point(poi);
np1 = ite->point(poi+1);
2202,6 → 2207,7
tmp += QString("L%1 %2 ").arg(np3.x()).arg(np3.y());
else
tmp += QString("C%1 %2 %3 %4 %5 %6 ").arg(np1.x()).arg(np1.y()).arg(np2.x()).arg(np2.y()).arg(np3.x()).arg(np3.y());
np4 = np3;
}
}
if (closed)
/trunk/Scribus/scribus/pslib.cpp
4805,8 → 4805,9
 
void PSLib::SetClipPath(FPointArray *c, bool poly)
{
FPoint np, np1, np2, np3;
FPoint np, np1, np2, np3, np4, firstP;
bool nPath = true;
bool first = true;
if (c->size() > 3)
{
for (uint poi=0; poi<c->size()-3; poi += 4)
4813,8 → 4814,6
{
if (c->point(poi).x() > 900000)
{
if (poly)
PS_closepath();
nPath = true;
continue;
}
4821,8 → 4820,13
if (nPath)
{
np = c->point(poi);
if ((!first) && (poly) && (np4 == firstP))
PS_closepath();
PS_moveto(np.x(), -np.y());
nPath = false;
first = false;
firstP = np;
np4 = np;
}
np = c->point(poi);
np1 = c->point(poi+1);
4832,10 → 4836,7
PS_lineto(np3.x(), -np3.y());
else
PS_curve(np1.x(), -np1.y(), np2.x(), -np2.y(), np3.x(), -np3.y());
/* np = c->point(poi+1);
np1 = c->point(poi+3);
np2 = c->point(poi+2);
PS_curve(np.x(), -np.y(), np1.x(), -np1.y(), np2.x(), -np2.y()); */
np4 = np3;
}
}
}