[gtk/glyph-clipping-fixes: 2/2] gtk-demo: Improve ink extents rendering




commit 7decc905090f6b61265fcd78113776aa5ce613d5
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 17 16:07:51 2021 -0400

    gtk-demo: Improve ink extents rendering
    
    Show the pixel-aligned ink rectangle, so we can
    see that it includes all the pixels that are inked.

 demos/gtk-demo/fontrendering.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/demos/gtk-demo/fontrendering.c b/demos/gtk-demo/fontrendering.c
index 97eff2f597..850977f8bd 100644
--- a/demos/gtk-demo/fontrendering.c
+++ b/demos/gtk-demo/fontrendering.c
@@ -37,7 +37,7 @@ update_image (void)
   const char *text;
   PangoFontDescription *desc;
   PangoLayout *layout;
-  PangoRectangle ink, pink, logical;
+  PangoRectangle ink, logical;
   int baseline;
   cairo_surface_t *surface;
   cairo_t *cr;
@@ -165,10 +165,10 @@ update_image (void)
           cairo_stroke (cr);
           cairo_set_source_rgb (cr, 1, 0, 0);
           cairo_rectangle (cr,
-                           scale * (10 + pango_units_to_double (pink.x)) + 0.5,
-                           scale * (10 + pango_units_to_double (pink.y)) + 0.5,
-                           scale * pango_units_to_double (pink.width) - 1,
-                           scale * pango_units_to_double (pink.height) - 1);
+                           scale * (10 + ink.x) - 0.5,
+                           scale * (10 + ink.y) - 0.5,
+                           scale * ink.width + 1,
+                           scale * ink.height + 1);
           cairo_stroke (cr);
         }
 


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