From d20a076c12c540131c3b0648e7733916b9526e6b Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Thu, 18 Apr 2013 15:43:04 -0400 Subject: Path Union. fix for Bug 614577 Fixed bugs: - https://launchpad.net/bugs/614577 (bzr r12279) --- src/livarot/ShapeSweep.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index 2073d1cd2..c2fd83e31 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -2741,8 +2741,9 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, { if (TesteAdjacency (lS, lB, getPoint(n).x, n, false) == false) - break; - lS->swsData[lB].leftRnd = n; + break; + if (getPoint(lS->swsData[lB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 + lS->swsData[lB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { @@ -2768,7 +2769,8 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, if (TesteAdjacency (rS, rB, getPoint(n).x, n, false) == false) break; - rS->swsData[rB].leftRnd = n; + if (getPoint(rS->swsData[rB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 + rS->swsData[rB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { -- cgit v1.2.3 From ced7761e69301a40944684fd295a04ea9e736c24 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 1 Jul 2013 17:51:53 -0400 Subject: Shape calculations. do not quantize the coordinates. (Bug 168158) Fixed bugs: - https://launchpad.net/bugs/168158 (bzr r12399) --- src/livarot/ShapeSweep.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index c2fd83e31..ffe5a9d73 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -250,8 +250,8 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; @@ -1051,8 +1051,8 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; -- cgit v1.2.3 From 4e088d33c04329fe57ef987d577f5aa57f83b644 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Tue, 16 Jul 2013 15:46:56 -0400 Subject: Shape calculations. re-introduce grid of a smaller size. (http://article.gmane.org/gmane.comp.graphics.inkscape.devel/40786) (bzr r12420) --- src/livarot/ShapeSweep.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index ffe5a9d73..c2fd83e31 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -250,8 +250,8 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) } Geom::Point rPtX; - rPtX[0]= /*Round*/ (ptX[0]); - rPtX[1]= /*Round*/ (ptX[1]); + rPtX[0]= Round (ptX[0]); + rPtX[1]= Round (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; @@ -1051,8 +1051,8 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) } Geom::Point rPtX; - rPtX[0]= /*Round*/ (ptX[0]); - rPtX[1]= /*Round*/ (ptX[1]); + rPtX[0]= Round (ptX[0]); + rPtX[1]= Round (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; -- cgit v1.2.3 From 2580137d7c69ba5752ca7ce698d6cf104ff7f00c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:57:37 +0200 Subject: fix small "performance" issues (cppcheck) (bzr r12461) --- src/livarot/ShapeSweep.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index c2fd83e31..ff58b4a71 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -252,8 +252,7 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) Geom::Point rPtX; rPtX[0]= Round (ptX[0]); rPtX[1]= Round (ptX[1]); - int lastPointNo = -1; - lastPointNo = AddPoint (rPtX); + int lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; if (rPtX[1] > lastChange) @@ -1053,8 +1052,7 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) Geom::Point rPtX; rPtX[0]= Round (ptX[0]); rPtX[1]= Round (ptX[1]); - int lastPointNo = -1; - lastPointNo = AddPoint (rPtX); + int lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; if (rPtX[1] > lastChange) -- cgit v1.2.3 From 7debcf27e2e4b795a1a8d56155515ddf5fecf33d Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 14 Sep 2013 15:54:11 -0400 Subject: Path->Inset. remove redundant node on inner join. (Bug 1218333) Fixed bugs: - https://launchpad.net/bugs/1218333 (bzr r12518) --- src/livarot/ShapeSweep.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index ff58b4a71..1954139fa 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -2672,7 +2672,8 @@ Shape::TesteAdjacency (Shape * a, int no, const Geom::Point atx, int nPt, double e = IHalfRound ((cross (diff,adir)) * 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, + double rad = HalfRound (1); +// double rad = HalfRound (0.501); // when using single precision, 0.505 is better (0.5 would be the correct value, // but it produces lots of bugs) diff1[0] = diff[0] - rad; diff1[1] = diff[1] - rad; -- cgit v1.2.3 From 96ada89a33df01376c60261f4046be52d7db185e Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sun, 15 Sep 2013 16:09:57 -0400 Subject: Path->Inset trial 2. revert rev 12279. (fix Bug 1218333) Fixed bugs: - https://launchpad.net/bugs/1218333 (bzr r12524) --- src/livarot/ShapeSweep.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/livarot/ShapeSweep.cpp') diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index 1954139fa..b04b36bfd 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -2672,8 +2672,7 @@ Shape::TesteAdjacency (Shape * a, int no, const Geom::Point atx, int nPt, double e = IHalfRound ((cross (diff,adir)) * a->eData[no].isqlength); if (-3 < e && e < 3) { - double rad = HalfRound (1); -// double rad = HalfRound (0.501); // when using single precision, 0.505 is better (0.5 would be the correct value, + double rad = HalfRound (0.501); // when using single precision, 0.505 is better (0.5 would be the correct value, // but it produces lots of bugs) diff1[0] = diff[0] - rad; diff1[1] = diff[1] - rad; @@ -2741,8 +2740,7 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, if (TesteAdjacency (lS, lB, getPoint(n).x, n, false) == false) break; - if (getPoint(lS->swsData[lB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 - lS->swsData[lB].leftRnd = n; + lS->swsData[lB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { @@ -2768,8 +2766,7 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, if (TesteAdjacency (rS, rB, getPoint(n).x, n, false) == false) break; - if (getPoint(rS->swsData[rB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 - rS->swsData[rB].leftRnd = n; + rS->swsData[rB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { -- cgit v1.2.3