[PATCH] gdiplus: Implement transform matrix for line gradient brushes

Vincent Povirk madewokherd at gmail.com
Tue Aug 15 12:47:48 CDT 2017


I wrote a test program (attached), and it doesn't work when the start
point isn't 0,0.

> +    if (line->startpoint.X == line->endpoint.X)
> +        t = line->startpoint.Y > line->endpoint.Y ? 3.f * M_PI / 2.f : M_PI / 2.f;
> +    else
> +        t = atanf((line->endpoint.Y - line->startpoint.Y) / (line->endpoint.X - line->startpoint.X));
> +
> +    t_cos = cosf(t);
> +    t_sin = sinf(t);

This seems like an oddly complicated and fragile way to normalize a vector.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linegradtest.c
Type: text/x-csrc
Size: 4268 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20170815/9cff43da/attachment.c>


More information about the wine-devel mailing list