Commit 50acfd7d authored by Raph Levien's avatar Raph Levien

A better fix to the winding rule handling of negative winding paths.

parent f6cae9e3
Sun Jun 13 21:07:20 1999 Raph Levien <raph@gimp.org>
* art_svp_wind.c (art_svp_rewind_uncrossed): Made the winding
rule logic even more correct :). I somehow missed the fact that
a clockwise path should be given a winding number of zero;
last night's commit tried to make it -1 (which worked for the
test cases I was using).
Sun Jun 13 01:23:14 1999 Raph Levien <raph@gimp.org>
* art_svp_wind.c (art_svp_rewind_uncrossed): Change to winding
......
......@@ -1365,15 +1365,8 @@ art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule)
/* Determine winding number for this segment */
if (i == 0)
{
if (vp->segs[seg_idx].dir)
wind = 1;
else
wind = -1;
}
else
{
if (vp->segs[active_segs[i - 1]].dir)
left_wind = 0;
else if (vp->segs[active_segs[i - 1]].dir)
left_wind = winding[active_segs[i - 1]];
else
left_wind = winding[active_segs[i - 1]] - 1;
......@@ -1382,15 +1375,14 @@ art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule)
wind = left_wind + 1;
else
wind = left_wind;
}
winding[seg_idx] = wind;
switch (rule)
{
case ART_WIND_RULE_NONZERO:
keep = (wind == 1 || wind == -1);
invert = (wind < 0);
keep = (wind == 1 || wind == 0);
invert = (wind == 0);
break;
case ART_WIND_RULE_INTERSECT:
keep = (wind == 2);
......@@ -1398,7 +1390,7 @@ art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule)
break;
case ART_WIND_RULE_ODDEVEN:
keep = 1;
invert = (wind & 1) ^ (wind > 0);
invert = !(wind & 1);
break;
case ART_WIND_RULE_POSITIVE:
keep = (wind == 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment