diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-06-22 11:41:16 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-06-22 11:41:16 +0000 |
commit | ca6c465c7589afeca8b201dfda75a1aa0621e55d (patch) | |
tree | 89810375953cbaa86302bd4aef791e49ad646b8a | |
parent | 5156e4c7f837e757551f7e7c5710cd143df56ac0 (diff) | |
parent | 0edd33e9ddf8df1dab98bee5fdc7c4c3fd0d0c03 (diff) | |
download | pango-ca6c465c7589afeca8b201dfda75a1aa0621e55d.tar.gz |
Merge branch 'matthiasc/for-main' into 'main'
Avoid overflow when calculating caret slope
See merge request GNOME/pango!626
-rw-r--r-- | pango/pango-layout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 2b03ee2c..165c6a7f 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 * y_scale) / (double) (caret_rise * x_scale); + slope_inv = (caret_run / (double) caret_rise) * (y_scale / (double) x_scale); if (strong_pos) { |