[gtk/wip/baedert/for-master: 8/11] GskTransform: add assertions to make normalize_angle() intenations clear
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 8/11] GskTransform: add assertions to make normalize_angle() intenations clear
- Date: Mon, 3 Feb 2020 10:30:55 +0000 (UTC)
commit 8ad4ee1bdfeddebd043fcca0f89425b284caefe0
Author: Timm Bäder <mail baedert org>
Date: Sun Feb 2 13:20:40 2020 +0100
GskTransform: add assertions to make normalize_angle() intenations clear
360deg should be expressed as 0deg and no angle should every be
negative.
gsk/gsktransform.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 5d9d538d4c..f116b79acd 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -834,6 +834,9 @@ normalize_angle (float angle)
if (f < 0)
f = 360 + f;
+ g_assert (f < 360.0);
+ g_assert (f >= 0.0);
+
return f;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]