Skip to content

Commit 5bed6d1

Browse files
committed
Merge with v6.1.3a
1 parent 5760dbb commit 5bed6d1

File tree

98 files changed

+4860
-3676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+4860
-3676
lines changed

C#/GuiDemo/GuiDemo/Form1.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ private void DrawBitmap(bool justClip = false)
459459
{
460460
Polygons solution2 = new Polygons();
461461
Clipper c = new Clipper();
462-
c.AddPolygons(subjects, PolyType.ptSubject);
463-
c.AddPolygons(clips, PolyType.ptClip);
462+
c.AddPaths(subjects, PolyType.ptSubject, true);
463+
c.AddPaths(clips, PolyType.ptClip, true);
464464
solution.Clear();
465465
#if UsePolyTree
466466
bool succeeded = c.Execute(GetClipType(), solutionTree, GetPolyFillType(), GetPolyFillType());
@@ -486,7 +486,9 @@ private void DrawBitmap(bool justClip = false)
486486

487487
if (nudOffset.Value != 0)
488488
{
489-
solution2 = Clipper.OffsetPolygons(solution, (double)nudOffset.Value * scale, JoinType.jtRound);
489+
ClipperOffset co = new ClipperOffset();
490+
co.AddPaths(solution, JoinType.jtRound, EndType.etClosedPolygon);
491+
co.Execute(ref solution2, (double)nudOffset.Value * scale);
490492
}
491493
else
492494
solution2 = new Polygons(solution);
@@ -509,14 +511,14 @@ private void DrawBitmap(bool justClip = false)
509511
SolidBrush b = new SolidBrush(Color.Navy);
510512
double subj_area = 0, clip_area = 0, int_area = 0, union_area = 0;
511513
c.Clear();
512-
c.AddPolygons(subjects, PolyType.ptSubject);
514+
c.AddPaths(subjects, PolyType.ptSubject, true);
513515
c.Execute(ClipType.ctUnion, solution2, GetPolyFillType(), GetPolyFillType());
514516
foreach (Polygon pg in solution2) subj_area += Clipper.Area(pg);
515517
c.Clear();
516-
c.AddPolygons(clips, PolyType.ptClip);
518+
c.AddPaths(clips, PolyType.ptClip, true);
517519
c.Execute(ClipType.ctUnion, solution2, GetPolyFillType(), GetPolyFillType());
518520
foreach (Polygon pg in solution2) clip_area += Clipper.Area(pg);
519-
c.AddPolygons(subjects, PolyType.ptSubject);
521+
c.AddPaths(subjects, PolyType.ptSubject, true);
520522
c.Execute(ClipType.ctIntersection, solution2, GetPolyFillType(), GetPolyFillType());
521523
foreach (Polygon pg in solution2) int_area += Clipper.Area(pg);
522524
c.Execute(ClipType.ctUnion, solution2, GetPolyFillType(), GetPolyFillType());

0 commit comments

Comments
 (0)