Skip to content

Commit

Permalink
Fix the AGG stroke -> O2 path converter (CGContextReplacePathWithStro…
Browse files Browse the repository at this point in the history
…kedPath doesn't properly close the stroked path)
  • Loading branch information
airy10 committed Sep 17, 2013
1 parent 911cce9 commit a525034
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions O2Context_AntiGrain/O2Context_AntiGrain.mm
Expand Up @@ -943,7 +943,7 @@ void clipBox(int a, int b, int c, int d)
int type;
O2ContextBeginPath(self);
while ((type = stroke.vertex(&x,&y)) != agg::path_cmd_stop) {
switch (type) {
switch (type & agg::path_cmd_mask) {
case agg::path_cmd_move_to: {
O2ContextMoveToPoint(self, x, y);
}
Expand All @@ -968,12 +968,14 @@ void clipBox(int a, int b, int c, int d)
double to_x, to_y;
stroke.vertex(&to_x,&to_y);
O2ContextAddCurveToPoint(self, x, y, ctrl2_x, ctrl2_y, to_x, to_y);

}
}
break;
case agg::path_cmd_end_poly: {
O2ContextClosePath(self);
if (type & agg::path_flags_close) {
O2ContextClosePath(self);
}
}
break;

default:
break;
Expand Down

0 comments on commit a525034

Please sign in to comment.