diff options
author | Benjamin Otte <otte@redhat.com> | 2021-11-28 08:00:52 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-11-30 14:12:10 +0100 |
commit | 291c50202afa6100797a0e30ad485fd5d98986b1 (patch) | |
tree | 16949b291dd8ecf8f41176a1282ef53d1724e1f2 /gsk | |
parent | ce8faa2e904769aee7f609df00135cb2887615e2 (diff) | |
download | gtk+-291c50202afa6100797a0e30ad485fd5d98986b1.tar.gz |
rendernode: Simplify conic gradient code
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/gskrendernodeimpl.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 76592973a2..207e3e68de 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -828,18 +828,14 @@ project (double angle, { double x, y; - x = radius * cos (angle); - y = radius * sin (angle); - if (copysign (x, 1.0) > copysign (y, 1.0)) - { - *x_out = copysign (radius, x); - *y_out = y * radius / copysign (x, 1.0); - } - else - { - *x_out = x * radius / copysign (y, 1.0); - *y_out = copysign (radius, y); - } +#ifdef HAVE_SINCOS + sincos (angle, &y, &x); +#else + x = cos (angle); + y = sin (angle); +#endif + *x_out = radius * x; + *y_out = radius * y; } static void |