summaryrefslogtreecommitdiff
path: root/third_party/agg23/agg_math_stroke.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/agg23/agg_math_stroke.h')
-rw-r--r--third_party/agg23/agg_math_stroke.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/third_party/agg23/agg_math_stroke.h b/third_party/agg23/agg_math_stroke.h
index 620d675312..ff42b2291e 100644
--- a/third_party/agg23/agg_math_stroke.h
+++ b/third_party/agg23/agg_math_stroke.h
@@ -67,8 +67,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
a2 -= da / 4;
a1 += da;
while(a1 < a2) {
- out_vertices.add(coord_type(x + FXSYS_Mul(width, FXSYS_cos(a1)),
- y + FXSYS_Mul(width, FXSYS_sin(a1))));
+ out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
+ y + (width * FXSYS_sin(a1))));
a1 += da;
}
} else {
@@ -78,8 +78,8 @@ void stroke_calc_arc(VertexConsumer& out_vertices,
a2 += da / 4;
a1 -= da;
while(a1 > a2) {
- out_vertices.add(coord_type(x + FXSYS_Mul(width, FXSYS_cos(a1)),
- y + FXSYS_Mul(width, FXSYS_sin(a1))));
+ out_vertices.add(coord_type(x + (width * FXSYS_cos(a1)),
+ y + (width * FXSYS_sin(a1))));
a1 -= da;
}
}
@@ -107,7 +107,7 @@ void stroke_calc_miter(VertexConsumer& out_vertices,
v2.x + dx2, v2.y - dy2,
&xi, &yi)) {
FX_FLOAT d1 = calc_distance(v1.x, v1.y, xi, yi);
- FX_FLOAT lim = FXSYS_Mul(width, miter_limit);
+ FX_FLOAT lim = width * miter_limit;
if(d1 <= lim) {
out_vertices.add(coord_type(xi, yi));
miter_limit_exceeded = false;
@@ -115,8 +115,8 @@ void stroke_calc_miter(VertexConsumer& out_vertices,
} else {
FX_FLOAT x2 = v1.x + dx1;
FX_FLOAT y2 = v1.y - dy1;
- if((FXSYS_Mul(x2 - v0.x, dy1) - FXSYS_Mul(v0.y - y2, dx1) < 0) !=
- (FXSYS_Mul(x2 - v2.x, dy1) - FXSYS_Mul(v2.y - y2, dx1) < 0)) {
+ if ((((x2 - v0.x) * dy1) - ((v0.y - y2) * dx1) < 0) !=
+ (((x2 - v2.x) * dy1) - ((v2.y - y2) * dx1) < 0)) {
out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1));
miter_limit_exceeded = false;
}
@@ -133,10 +133,10 @@ void stroke_calc_miter(VertexConsumer& out_vertices,
width, approximation_scale);
break;
default:
- out_vertices.add(coord_type(v1.x + dx1 + FXSYS_Mul(dy1, miter_limit),
- v1.y - dy1 + FXSYS_Mul(dx1, miter_limit)));
- out_vertices.add(coord_type(v1.x + dx2 - FXSYS_Mul(dy2, miter_limit),
- v1.y - dy2 - FXSYS_Mul(dx2, miter_limit)));
+ out_vertices.add(coord_type(v1.x + dx1 + (dy1 * miter_limit),
+ v1.y - dy1 + (dx1 * miter_limit)));
+ out_vertices.add(coord_type(v1.x + dx2 - (dy2 * miter_limit),
+ v1.y - dy2 - (dx2 * miter_limit)));
break;
}
}
@@ -156,8 +156,8 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
FX_FLOAT dy1 = FXSYS_Div(v1.x - v0.x, len);
FX_FLOAT dx2 = 0;
FX_FLOAT dy2 = 0;
- dx1 = FXSYS_Mul(dx1, width);
- dy1 = FXSYS_Mul(dy1, width);
+ dx1 = dx1 * width;
+ dy1 = dy1 * width;
if(line_cap != round_cap) {
if(line_cap == square_cap) {
dx2 = dy1;
@@ -174,8 +174,8 @@ void stroke_calc_cap(VertexConsumer& out_vertices,
a1 += da;
a2 -= da / 4;
while(a1 < a2) {
- out_vertices.add(coord_type(v0.x + FXSYS_Mul(width, FXSYS_cos(a1)),
- v0.y + FXSYS_Mul(width, FXSYS_sin(a1))));
+ out_vertices.add(coord_type(v0.x + (width * FXSYS_cos(a1)),
+ v0.y + (width * FXSYS_sin(a1))));
a1 += da;
}
out_vertices.add(coord_type(v0.x + dx1, v0.y - dy1));