[pango/pango2-windows: 7/7] pango-matrix.c: Correct call to CLAMP()




commit addf600cdd19d24d540a51a6bd35109ffef45a14
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jun 24 09:41:26 2022 +0800

    pango-matrix.c: Correct call to CLAMP()
    
    It seems like acos() accepts [-1, 1], and the input value we want to check with
    CLAMP should be passed in first.

 pango/pango-matrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/pango-matrix.c b/pango/pango-matrix.c
index 4fb3d1308..3f263101d 100644
--- a/pango/pango-matrix.c
+++ b/pango/pango-matrix.c
@@ -269,7 +269,7 @@ pango_matrix_get_rotation (const PangoMatrix *matrix)
 
   pango_matrix_transform_distance (matrix, &x, &y);
 
-  return RAD_TO_DEG (acos (CLAMP (0., 1., x /  sqrtf (x*x + y*y))));
+  return RAD_TO_DEG (acos (CLAMP (x /  sqrtf (x*x + y*y), -1., 1.)));
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]