@@ -704,6 +704,28 @@ void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
704
704
y1 = std::ceil (((ip.X - 0.5 ) / Edge1.Dx + by1) - 0.5 );
705
705
}
706
706
}
707
+ else if (Edge1.Bot .Y > ip.Y )
708
+ {
709
+ if (Edge2.Bot .Y >= Edge1.Bot .Y )
710
+ {
711
+ y1 = Edge1.Bot .Y ;
712
+ }
713
+ else
714
+ {
715
+ y1 = Edge2.Bot .Y ;
716
+ }
717
+ }
718
+ else if (Edge1.Bot .Y < ip.Y )
719
+ {
720
+ if (Edge2.Bot .Y <= Edge1.Bot .Y )
721
+ {
722
+ y1 = Edge1.Bot .Y ;
723
+ }
724
+ else
725
+ {
726
+ y1 = Edge2.Bot .Y ;
727
+ }
728
+ }
707
729
if (ip.Y >= Edge1.Bot .Y && y1 < Edge1.Bot .Y ) y1 = Edge1.Bot .Y ;
708
730
else if (ip.Y <= Edge1.Bot .Y && y1 > Edge1.Bot .Y ) y1 = Edge1.Bot .Y ;
709
731
if (Edge2.Bot .X > ip.X )
@@ -728,6 +750,28 @@ void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
728
750
y2 = std::ceil (((ip.X - 0.5 ) / Edge2.Dx + by2) - 0.5 );
729
751
}
730
752
}
753
+ else if (Edge2.Bot .Y > ip.Y )
754
+ {
755
+ if (Edge1.Bot .Y >= Edge2.Bot .Y )
756
+ {
757
+ y2 = Edge2.Bot .Y ;
758
+ }
759
+ else
760
+ {
761
+ y2 = Edge1.Bot .Y ;
762
+ }
763
+ }
764
+ else if (Edge2.Bot .Y < ip.Y )
765
+ {
766
+ if (Edge1.Bot .Y <= Edge2.Bot .Y )
767
+ {
768
+ y2 = Edge2.Bot .Y ;
769
+ }
770
+ else
771
+ {
772
+ y2 = Edge1.Bot .Y ;
773
+ }
774
+ }
731
775
if (ip.Y >= Edge2.Bot .Y && y2 < Edge2.Bot .Y ) y2 = Edge2.Bot .Y ;
732
776
else if (ip.Y <= Edge2.Bot .Y && y2 > Edge2.Bot .Y ) y2 = Edge2.Bot .Y ;
733
777
cInt x1 = ip.X ;
@@ -754,6 +798,28 @@ void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
754
798
x1 = std::ceil (((ip.Y - 0.5 ) * Edge1.Dx + bx1) - 0.5 );
755
799
}
756
800
}
801
+ else if (Edge1.Bot .X > ip.X )
802
+ {
803
+ if (Edge2.Bot .X >= Edge1.Bot .X )
804
+ {
805
+ x1 = Edge1.Bot .X ;
806
+ }
807
+ else
808
+ {
809
+ x1 = Edge2.Bot .X ;
810
+ }
811
+ }
812
+ else if (Edge1.Bot .X < ip.X )
813
+ {
814
+ if (Edge2.Bot .X <= Edge1.Bot .X )
815
+ {
816
+ x1 = Edge1.Bot .X ;
817
+ }
818
+ else
819
+ {
820
+ x1 = Edge2.Bot .X ;
821
+ }
822
+ }
757
823
if (ip.X >= Edge1.Bot .X && x1 < Edge1.Bot .X ) x1 = Edge1.Bot .X ;
758
824
else if (ip.X <= Edge1.Bot .X && x1 > Edge1.Bot .X ) x1 = Edge1.Bot .X ;
759
825
if (Edge2.Bot .Y > ip.Y )
@@ -778,6 +844,28 @@ void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
778
844
x2 = std::ceil (((ip.Y - 0.5 ) * Edge2.Dx + bx2) - 0.5 );
779
845
}
780
846
}
847
+ else if (Edge2.Bot .X > ip.X )
848
+ {
849
+ if (Edge1.Bot .X >= Edge2.Bot .X )
850
+ {
851
+ x2 = Edge2.Bot .X ;
852
+ }
853
+ else
854
+ {
855
+ x2 = Edge1.Bot .X ;
856
+ }
857
+ }
858
+ else if (Edge2.Bot .X < ip.X )
859
+ {
860
+ if (Edge1.Bot .X <= Edge2.Bot .X )
861
+ {
862
+ x2 = Edge2.Bot .X ;
863
+ }
864
+ else
865
+ {
866
+ x2 = Edge1.Bot .X ;
867
+ }
868
+ }
781
869
if (ip.X >= Edge2.Bot .X && x2 < Edge2.Bot .X ) x2 = Edge2.Bot .X ;
782
870
else if (ip.X <= Edge2.Bot .X && x2 > Edge2.Bot .X ) x2 = Edge2.Bot .X ;
783
871
if (y1 > ip.Y && y2 > ip.Y )
@@ -3469,6 +3557,7 @@ int PointCount(OutPt *Pts)
3469
3557
while (p != Pts);
3470
3558
return result;
3471
3559
}
3560
+
3472
3561
// ------------------------------------------------------------------------------
3473
3562
3474
3563
void Clipper::BuildResult (Paths &polys)
0 commit comments