Module: wine Branch: master Commit: aea505f58c0b5b9a24d23c87153bf9b6a7deb918 URL: https://gitlab.winehq.org/wine/wine/-/commit/aea505f58c0b5b9a24d23c87153bf9b...
Author: Esme Povirk esme@codeweavers.com Date: Mon May 6 14:08:22 2024 -0500
gdiplus: Remove unnecessary math in add_anchor.
These additions and subtractions cancel each other out.
---
dlls/gdiplus/graphicspath.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 105df4cacfd..94fae70ad88 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -2264,8 +2264,8 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint, cosa = pen_width * custom->scale * segment_dy / segment_length;
/* Coordination where cap needs to be drawn */ - posx = endpoint->X + sina; - posy = endpoint->Y - cosa; + posx = endpoint->X; + posy = endpoint->Y;
if (!custom->fill) { @@ -2277,8 +2277,8 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
for (INT i = 0; i < custom->pathdata.Count; i++) { - tmp_points[i].X = posx + custom->pathdata.Points[i].X * cosa + (custom->pathdata.Points[i].Y - 1.0) * sina; - tmp_points[i].Y = posy + custom->pathdata.Points[i].X * sina - (custom->pathdata.Points[i].Y - 1.0) * cosa; + tmp_points[i].X = posx + custom->pathdata.Points[i].X * cosa + custom->pathdata.Points[i].Y * sina; + tmp_points[i].Y = posy + custom->pathdata.Points[i].X * sina - custom->pathdata.Points[i].Y * cosa; } if ((custom->pathdata.Types[custom->pathdata.Count - 1] & PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) widen_closed_figure(tmp_points, 0, custom->pathdata.Count - 1, pen, pen_width, last_point); @@ -2291,8 +2291,8 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint, for (INT i = 0; i < custom->pathdata.Count; i++) { /* rotation of CustomCap according to line */ - perp_dx = custom->pathdata.Points[i].X * cosa + (custom->pathdata.Points[i].Y - 1.0) * sina; - perp_dy = custom->pathdata.Points[i].X * sina - (custom->pathdata.Points[i].Y - 1.0) * cosa; + perp_dx = custom->pathdata.Points[i].X * cosa + custom->pathdata.Points[i].Y * sina; + perp_dy = custom->pathdata.Points[i].X * sina - custom->pathdata.Points[i].Y * cosa; *last_point = add_path_list_node(*last_point, posx + perp_dx, posy + perp_dy, custom->pathdata.Types[i]); }