[pango/pango2: 3/301] Revert "Avoid overflow when calculating caret slope"




commit f6e2519f98ba33d8d80080a6f88a73f2dff56d51
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jun 22 11:33:14 2022 -0400

    Revert "Avoid overflow when calculating caret slope"
    
    This reverts commit 0edd33e9ddf8df1dab98bee5fdc7c4c3fd0d0c03.

 pango/pango-layout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 165c6a7f7..2b03ee2c6 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2729,7 +2729,7 @@ pango_layout_get_caret_pos (PangoLayout    *layout,
         return;
 
       hb_font_get_scale (hb_font, &x_scale, &y_scale);
-      slope_inv = (caret_run / (double) caret_rise) * (y_scale / (double) x_scale);
+      slope_inv = (caret_run * y_scale) / (double) (caret_rise * x_scale);
 
       if (strong_pos)
         {


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