Clipper2
Clipper2 copied to clipboard
`RectClip` not always preserving orientation
The documentation states:
RectClip preserves path orientation
Either I've misunderstood something, or here's a counter-example:
TEST(Clipper2Tests, TestRectClipOrientation)
{
const Rect64 rect(1222, 1323, 3247, 3348);
const Path64 subject = MakePath({ 375,1680, 1915,4716, 5943,586, 3987,152 });
RectClip64 clip(rect);
const auto solution = clip.Execute({ subject });
ASSERT_EQ(solution.size(), 1);
EXPECT_EQ(IsPositive(subject), IsPositive(solution.front()));
}
I'm not saying it's not a corner case (literally!):
However, this is a simplified version of a much more complex case that I accidentally stumbled upon.