Clemens Tamme : gdiplus: Implement triangular line caps in widened paths.
Alexandre Julliard
julliard at winehq.org
Mon Jun 19 14:49:29 CDT 2017
Module: wine
Branch: master
Commit: 260cbd022e43b9385b8d501de412151d89debd6a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=260cbd022e43b9385b8d501de412151d89debd6a
Author: Clemens Tamme <clemens.tamme at gmail.com>
Date: Sat Jun 17 17:28:28 2017 +0200
gdiplus: Implement triangular line caps in widened paths.
Signed-off-by: Clemens Tamme <clemens.tamme at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/graphicspath.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index 3d33c29..e34f4ed 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -1883,6 +1883,27 @@ static void widen_cap(const GpPointF *endpoint, const GpPointF *nextpoint,
}
break;
}
+ case LineCapTriangle:
+ {
+ REAL segment_dy = nextpoint->Y-endpoint->Y;
+ REAL segment_dx = nextpoint->X-endpoint->X;
+ REAL segment_length = sqrtf(segment_dy*segment_dy + segment_dx*segment_dx);
+ REAL distance = pen->width/2.0;
+ REAL dx, dy;
+
+ dx = distance * segment_dx / segment_length;
+ dy = distance * segment_dy / segment_length;
+
+ if (add_first_points) {
+ add_bevel_point(endpoint, nextpoint, pen, 1, last_point);
+
+ *last_point = add_path_list_node(*last_point, endpoint->X - dx,
+ endpoint->Y - dy, PathPointTypeLine);
+ }
+ if (add_last_point)
+ add_bevel_point(endpoint, nextpoint, pen, 0, last_point);
+ break;
+ }
}
}
@@ -2118,10 +2139,10 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
{
last_point = points;
- if (pen->endcap > LineCapRound)
+ if (pen->endcap > LineCapTriangle)
FIXME("unimplemented end cap %x\n", pen->endcap);
- if (pen->startcap > LineCapRound)
+ if (pen->startcap > LineCapTriangle)
FIXME("unimplemented start cap %x\n", pen->startcap);
if (pen->dashcap != DashCapFlat)
More information about the wine-cvs
mailing list