[gtk/wip/otte/for-master: 1/2] rendernode: Simplify conic gradient code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 1/2] rendernode: Simplify conic gradient code
- Date: Sun, 28 Nov 2021 07:06:50 +0000 (UTC)
commit e8d92388aebd2bd76c999f543d71b5712bb4c730
Author: Benjamin Otte <otte redhat com>
Date: Sun Nov 28 08:00:52 2021 +0100
rendernode: Simplify conic gradient code
gsk/gskrendernodeimpl.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 76592973a2..494927d335 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -828,18 +828,9 @@ 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);
- }
+ sincos (angle, &y, &x);
+ *x_out = radius * x;
+ *y_out = radius * y;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]