gdiplus: Fix position of Custom Cap when Scale is different that 1.

This commit is contained in:
Bartosz Kosiorek 2022-11-24 19:49:36 +01:00 committed by Alexandre Julliard
parent be7db8457d
commit 0fd51346e1

View file

@ -2128,13 +2128,13 @@ static void add_anchor(const GpPointF *endpoint, const GpPointF *nextpoint,
TRACE("GpCustomLineCap fill: %d basecap: %d inset: %f join: %d scale: %f pen_width:%f\n",
custom->fill, custom->basecap, custom->inset, custom->join, custom->scale, pen_width);
/* Coordination where cap needs to be drawn */
posx = endpoint->X - pen_width * segment_dx / segment_length;
posy = endpoint->Y - pen_width * segment_dy / segment_length;
sina = -pen_width * custom->scale * segment_dx / segment_length;
cosa = pen_width * custom->scale * segment_dy / segment_length;
/* Coordination where cap needs to be drawn */
posx = endpoint->X + sina;
posy = endpoint->Y - cosa;
if (!custom->fill)
{
tmp_points = heap_alloc_zero(custom->pathdata.Count * sizeof(GpPoint));