thestig | 8833342 | 2016-04-06 23:57:31 -0700 | [diff] [blame] | 1 | diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h |
| 2 | index 6d7ba8a..2b06b1b 100644 |
| 3 | --- a/third_party/agg23/agg_math_stroke.h |
| 4 | +++ b/third_party/agg23/agg_math_stroke.h |
| 5 | @@ -60,28 +60,30 @@ void stroke_calc_arc(VertexConsumer& out_vertices, |
| 6 | } |
Dan Sinclair | 669a418 | 2017-04-03 14:51:45 -0400 | [diff] [blame] | 7 | da = acos(width / (width + ((1.0f / 8) / approximation_scale))) * 2; |
thestig | 8833342 | 2016-04-06 23:57:31 -0700 | [diff] [blame] | 8 | out_vertices.add(coord_type(x + dx1, y + dy1)); |
| 9 | - if(!ccw) { |
| 10 | - if(a1 > a2) { |
| 11 | - a2 += 2 * FX_PI; |
| 12 | + if (da > 0) { |
| 13 | + if (!ccw) { |
| 14 | + if (a1 > a2) { |
| 15 | + a2 += 2 * FX_PI; |
| 16 | } |
| 17 | a2 -= da / 4; |
| 18 | a1 += da; |
| 19 | - while(a1 < a2) { |
| 20 | + while (a1 < a2) { |
Dan Sinclair | 669a418 | 2017-04-03 14:51:45 -0400 | [diff] [blame] | 21 | out_vertices.add(coord_type(x + (width * cos(a1)), |
| 22 | y + (width * sin(a1)))); |
thestig | 8833342 | 2016-04-06 23:57:31 -0700 | [diff] [blame] | 23 | - a1 += da; |
| 24 | + a1 += da; |
| 25 | } |
| 26 | - } else { |
| 27 | - if(a1 < a2) { |
| 28 | - a2 -= 2 * FX_PI; |
| 29 | + } else { |
| 30 | + if (a1 < a2) { |
| 31 | + a2 -= 2 * FX_PI; |
| 32 | } |
| 33 | a2 += da / 4; |
| 34 | a1 -= da; |
| 35 | - while(a1 > a2) { |
| 36 | + while (a1 > a2) { |
Dan Sinclair | 669a418 | 2017-04-03 14:51:45 -0400 | [diff] [blame] | 37 | out_vertices.add(coord_type(x + (width * cos(a1)), |
| 38 | y + (width * sin(a1)))); |
thestig | 8833342 | 2016-04-06 23:57:31 -0700 | [diff] [blame] | 39 | - a1 -= da; |
| 40 | + a1 -= da; |
| 41 | } |
| 42 | + } |
| 43 | } |
| 44 | out_vertices.add(coord_type(x + dx2, y + dy2)); |
| 45 | } |