summaryrefslogtreecommitdiffstats
path: root/src/livarot
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-04-28 23:02:19 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-04-28 23:02:19 +0000
commitcfa7054c950050095e596edd18fedad53e7ed636 (patch)
tree2142ac03239c40a4af6b367754ddf3421e337577 /src/livarot
parent2Geom sync - initial commit (diff)
downloadinkscape-cfa7054c950050095e596edd18fedad53e7ed636.tar.gz
inkscape-cfa7054c950050095e596edd18fedad53e7ed636.zip
Fix calls to Geom::cross() - sign change.
(bzr r14059.2.2)
Diffstat (limited to 'src/livarot')
-rw-r--r--src/livarot/PathConversion.cpp6
-rw-r--r--src/livarot/PathCutting.cpp4
-rw-r--r--src/livarot/PathOutline.cpp8
-rw-r--r--src/livarot/PathSimplify.cpp2
-rw-r--r--src/livarot/PathStroke.cpp16
-rw-r--r--src/livarot/Shape.cpp4
-rw-r--r--src/livarot/ShapeSweep.cpp38
-rw-r--r--src/livarot/sweep-tree.cpp10
8 files changed, 44 insertions, 44 deletions
diff --git a/src/livarot/PathConversion.cpp b/src/livarot/PathConversion.cpp
index 42df898e6..30e21d546 100644
--- a/src/livarot/PathConversion.cpp
+++ b/src/livarot/PathConversion.cpp
@@ -716,7 +716,7 @@ static void ArcAnglesAndCenter(Geom::Point const &iS, Geom::Point const &iE,
{
Geom::Point se = iE - iS;
Geom::Point ca(cos(angle), sin(angle));
- Geom::Point cse(dot(se, ca), cross(se, ca));
+ Geom::Point cse(dot(ca, se), cross(ca, se));
cse[0] /= rx;
cse[1] /= ry;
double const lensq = dot(cse,cse);
@@ -753,8 +753,8 @@ static void ArcAnglesAndCenter(Geom::Point const &iS, Geom::Point const &iE,
csd[1] *= ry;
ca[1] = -ca[1]; // because it's the inverse rotation
- dr[0] = dot(csd, ca);
- dr[1] = cross(csd, ca);
+ dr[0] = dot(ca, csd);
+ dr[1] = cross(ca, csd);
ca[1] = -ca[1];
diff --git a/src/livarot/PathCutting.cpp b/src/livarot/PathCutting.cpp
index 49b2c5a78..12f2386b0 100644
--- a/src/livarot/PathCutting.cpp
+++ b/src/livarot/PathCutting.cpp
@@ -513,10 +513,10 @@ double Path::Surface()
for (std::vector<path_lineto>::const_iterator i = pts.begin(); i != pts.end(); ++i) {
if ( i->isMoveTo == polyline_moveto ) {
- surf += Geom::cross(lastM - lastP, lastM);
+ surf += Geom::cross(lastM, lastM - lastP);
lastP = lastM = i->p;
} else {
- surf += Geom::cross(i->p - lastP, i->p);
+ surf += Geom::cross(i->p, i->p - lastP);
lastP = i->p;
}
diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp
index 211ee31e2..e146bb908 100644
--- a/src/livarot/PathOutline.cpp
+++ b/src/livarot/PathOutline.cpp
@@ -1108,7 +1108,7 @@ Path::TangentOnCubAt (double at, Geom::Point const &iS, PathDescrCubicTo const &
}
return;
}
- rad = -l * (dot(dder,dder)) / (cross(ddder,dder));
+ rad = -l * (dot(dder,dder)) / (cross(dder, ddder));
tgt = dder / l;
if (before) {
tgt = -tgt;
@@ -1117,7 +1117,7 @@ Path::TangentOnCubAt (double at, Geom::Point const &iS, PathDescrCubicTo const &
}
len = l;
- rad = -l * (dot(der,der)) / (cross(dder,der));
+ rad = -l * (dot(der,der)) / (cross(der, dder));
tgt = der / l;
}
@@ -1156,7 +1156,7 @@ Path::TangentOnBezAt (double at, Geom::Point const &iS,
return;
}
len = l;
- rad = -l * (dot(der,der)) / (cross(dder,der));
+ rad = -l * (dot(der,der)) / (cross(der, dder));
tgt = der / l;
}
@@ -1180,7 +1180,7 @@ Path::OutlineJoin (Path * dest, Geom::Point pos, Geom::Point stNor, Geom::Point
TurnInside ^= PrevPos == pos;
PrevPos = pos;
- const double angSi = cross (enNor,stNor);
+ const double angSi = cross (stNor, enNor);
const double angCo = dot (stNor, enNor);
if ((fabs(angSi) < .0000001) && angCo > 0) { // The join is straight -> nothing to do.
diff --git a/src/livarot/PathSimplify.cpp b/src/livarot/PathSimplify.cpp
index 7d9f3f57d..81ddcd049 100644
--- a/src/livarot/PathSimplify.cpp
+++ b/src/livarot/PathSimplify.cpp
@@ -128,7 +128,7 @@ static double DistanceToCubic(Geom::Point const &start, PathDescrCubicTo res, Ge
}
Geom::Point seg = res.p - start;
- nnle = Geom::cross(seg, sp);
+ nnle = Geom::cross(sp, seg);
nnle *= nnle;
nnle /= Geom::dot(seg, seg);
if ( nnle < nle ) {
diff --git a/src/livarot/PathStroke.cpp b/src/livarot/PathStroke.cpp
index 6ec7fa209..4cfeb887a 100644
--- a/src/livarot/PathStroke.cpp
+++ b/src/livarot/PathStroke.cpp
@@ -292,7 +292,7 @@ void Path::DoJoin (Shape *dest, double width, JoinType join, Geom::Point pos, Ge
{
Geom::Point pnor = prev.ccw();
Geom::Point nnor = next.ccw();
- double angSi = cross(next, prev);
+ double angSi = cross(prev, next);
/* FIXED: this special case caused bug 1028953 */
if (angSi > -0.0001 && angSi < 0.0001) {
@@ -416,7 +416,7 @@ Path::DoLeftJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
{
Geom::Point pnor=prev.ccw();
Geom::Point nnor=next.ccw();
- double angSi = cross (next, prev);
+ double angSi = cross(prev, next);
if (angSi > -0.0001 && angSi < 0.0001)
{
double angCo = dot (prev, next);
@@ -444,7 +444,7 @@ Path::DoLeftJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
/* Geom::Point biss;
biss.x=next.x-prev.x;
biss.y=next.y-prev.y;
- double c2=cross(biss,next);
+ double c2=cross(next, biss);
double l=width/c2;
double projn=l*(dot(biss,next));
double projp=-l*(dot(biss,prev));
@@ -503,7 +503,7 @@ Path::DoLeftJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
}
else
{
- double s2 = cross (biss, nnor);
+ double s2 = cross(nnor, biss);
double dec = (l - emiter) * c2 / s2;
const Geom::Point tbiss=biss.ccw();
@@ -560,7 +560,7 @@ Path::DoRightJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
{
const Geom::Point pnor=prev.ccw();
const Geom::Point nnor=next.ccw();
- double angSi = cross (next,prev);
+ double angSi = cross(prev, next);
if (angSi > -0.0001 && angSi < 0.0001)
{
double angCo = dot (prev, next);
@@ -614,7 +614,7 @@ Path::DoRightJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
}
else
{
- double s2 = cross (biss, nnor);
+ double s2 = cross(nnor, biss);
double dec = (l - emiter) * c2 / s2;
const Geom::Point tbiss=biss.ccw();
@@ -667,7 +667,7 @@ Path::DoRightJoin (Shape * dest, double width, JoinType join, Geom::Point pos,
/* Geom::Point biss;
biss=next.x-prev.x;
biss.y=next.y-prev.y;
- double c2=cross(next,biss);
+ double c2=cross(biss, next);
double l=width/c2;
double projn=l*(dot(biss,next));
double projp=-l*(dot(biss,prev));
@@ -719,7 +719,7 @@ void Path::RecRound(Shape *dest, int sNo, int eNo, // start and end index
sia = 1;
} else {
double coa = dot(nS, nE);
- sia = cross(nS, nE);
+ sia = cross(nE, nS);
ang = acos(coa);
if ( coa >= 1 ) {
ang = 0;
diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp
index ac6c72342..0bb3390e8 100644
--- a/src/livarot/Shape.cpp
+++ b/src/livarot/Shape.cpp
@@ -1683,7 +1683,7 @@ Shape::CmpToVert (Geom::Point ax, Geom::Point bx,bool as,bool bs)
Geom::Point av, bv;
av = ax;
bv = bx;
- double si = cross (bv, av);
+ double si = cross(av, bv);
int tstSi = 0;
if (si > 0.000001) tstSi = 1;
if (si < -0.000001) tstSi = -1;
@@ -2104,7 +2104,7 @@ Shape::PtWinding (const Geom::Point px) const
}
Geom::Point const diff = px - ast;
- double const cote = cross(diff, adir);
+ double const cote = cross(adir, diff);
if (cote == 0) continue;
if (cote < 0) {
if (ast[0] > px[0]) lr += nWeight;
diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp
index b04b36bfd..1e6273964 100644
--- a/src/livarot/ShapeSweep.cpp
+++ b/src/livarot/ShapeSweep.cpp
@@ -1738,7 +1738,7 @@ Shape::TesteIntersection (SweepTree * iL, SweepTree * iR, Geom::Point &atx, doub
}
}
- double ang = cross (rdir, ldir);
+ double ang = cross (ldir, rdir);
// ang*=iL->src->eData[iL->bord].isqlength;
// ang*=iR->src->eData[iR->bord].isqlength;
if (ang <= 0) return false; // edges in opposite directions: <-left ... right ->
@@ -1776,12 +1776,12 @@ Shape::TesteIntersection (SweepTree * iL, SweepTree * iR, Geom::Point &atx, doub
double srDot, erDot;
sDiff = iL->src->pData[lSt].rx - iR->src->pData[rSt].rx;
eDiff = iL->src->pData[lEn].rx - iR->src->pData[rSt].rx;
- srDot = cross (sDiff,rdir);
- erDot = cross (eDiff,rdir);
+ srDot = cross(rdir, sDiff);
+ erDot = cross(rdir, eDiff);
sDiff = iR->src->pData[rSt].rx - iL->src->pData[lSt].rx;
eDiff = iR->src->pData[rEn].rx - iL->src->pData[lSt].rx;
- slDot = cross (sDiff,ldir);
- elDot = cross (eDiff,ldir);
+ slDot = cross(ldir, sDiff);
+ elDot = cross(ldir, eDiff);
if ((srDot >= 0 && erDot >= 0) || (srDot <= 0 && erDot <= 0))
{
@@ -2089,7 +2089,7 @@ Shape::Winding (const Geom::Point px) const
}
diff = px - ast;
- double cote = cross (diff,adir);
+ double cote = cross(adir, diff);
if (cote == 0)
continue;
if (cote < 0)
@@ -2563,15 +2563,15 @@ Shape::TesteIntersection (Shape * ils, Shape * irs, int ilb, int irb,
double srDot, erDot;
sDiff = ils->pData[lSt].rx - irs->pData[rSt].rx;
eDiff = ils->pData[lEn].rx - irs->pData[rSt].rx;
- srDot = cross (sDiff,rdir );
- erDot = cross (eDiff,rdir );
+ srDot = cross(rdir, sDiff);
+ erDot = cross(rdir, eDiff);
if ((srDot >= 0 && erDot >= 0) || (srDot <= 0 && erDot <= 0))
return false;
sDiff = irs->pData[rSt].rx - ils->pData[lSt].rx;
eDiff = irs->pData[rEn].rx - ils->pData[lSt].rx;
- slDot = cross (sDiff,ldir );
- elDot = cross (eDiff,ldir);
+ slDot = cross(ldir, sDiff);
+ elDot = cross(ldir, eDiff);
if ((slDot >= 0 && elDot >= 0) || (slDot <= 0 && elDot <= 0))
return false;
@@ -2615,8 +2615,8 @@ Shape::TesteIntersection (Shape * ils, Shape * irs, int ilb, int irb,
double sDot, eDot;
sDiff = ils->pData[lSt].rx - irs->pData[rSt].rx;
eDiff = ils->pData[lEn].rx - irs->pData[rSt].rx;
- sDot = cross (sDiff,rdir );
- eDot = cross (eDiff,rdir);
+ sDot = cross(rdir, sDiff);
+ eDot = cross(rdir, eDiff);
atx =
(sDot * irs->pData[lEn].rx - eDot * irs->pData[lSt].rx) / (sDot -
@@ -2625,8 +2625,8 @@ Shape::TesteIntersection (Shape * ils, Shape * irs, int ilb, int irb,
sDiff = irs->pData[rSt].rx - ils->pData[lSt].rx;
eDiff = irs->pData[rEn].rx - ils->pData[lSt].rx;
- sDot = cross (sDiff,ldir );
- eDot = cross (eDiff,ldir );
+ sDot = cross(ldir, sDiff);
+ eDot = cross(ldir, eDiff);
atR = sDot / (sDot - eDot);
@@ -2669,7 +2669,7 @@ Shape::TesteAdjacency (Shape * a, int no, const Geom::Point atx, int nPt,
diff = atx - ast;
- double e = IHalfRound ((cross (diff,adir)) * a->eData[no].isqlength);
+ double e = IHalfRound(cross(adir, diff) * a->eData[no].isqlength);
if (-3 < e && e < 3)
{
double rad = HalfRound (0.501); // when using single precision, 0.505 is better (0.5 would be the correct value,
@@ -2684,16 +2684,16 @@ Shape::TesteAdjacency (Shape * a, int no, const Geom::Point atx, int nPt,
diff4[1] = diff[1] + rad;
double di1, di2;
bool adjacent = false;
- di1 = cross (diff1,adir);
- di2 = cross (diff3,adir);
+ di1 = cross(adir, diff1);
+ di2 = cross(adir, diff3);
if ((di1 < 0 && di2 > 0) || (di1 > 0 && di2 < 0))
{
adjacent = true;
}
else
{
- di1 = cross ( diff2,adir);
- di2 = cross (diff4,adir);
+ di1 = cross(adir, diff2);
+ di2 = cross(adir, diff4);
if ((di1 < 0 && di2 > 0) || (di1 > 0 && di2 < 0))
{
adjacent = true;
diff --git a/src/livarot/sweep-tree.cpp b/src/livarot/sweep-tree.cpp
index 7a016a2ee..1b9868f2e 100644
--- a/src/livarot/sweep-tree.cpp
+++ b/src/livarot/sweep-tree.cpp
@@ -117,9 +117,9 @@ SweepTree::Find(Geom::Point const &px, SweepTree *newOne, SweepTree *&insertL,
nNorm=nNorm.ccw();
if (sweepSens) {
- y = cross(nNorm, bNorm);
- } else {
y = cross(bNorm, nNorm);
+ } else {
+ y = cross(nNorm, bNorm);
}
if (y == 0) {
y = dot(bNorm, nNorm);
@@ -345,7 +345,7 @@ SweepTree::InsertAt(SweepTreeList &list, SweepEventQueue &queue,
SweepTree *insertL = NULL;
SweepTree *insertR = NULL;
- double ang = cross(nNorm, bNorm);
+ double ang = cross(bNorm, nNorm);
if (ang == 0)
{
insertL = insNode;
@@ -384,7 +384,7 @@ SweepTree::InsertAt(SweepTreeList &list, SweepEventQueue &queue,
{
bNorm = -bNorm;
}
- ang = cross(nNorm, bNorm);
+ ang = cross(bNorm, nNorm);
if (ang <= 0)
{
break;
@@ -426,7 +426,7 @@ SweepTree::InsertAt(SweepTreeList &list, SweepEventQueue &queue,
{
bNorm = -bNorm;
}
- ang = cross(nNorm, bNorm);
+ ang = cross(bNorm, nNorm);
if (ang > 0)
{
break;