[gtk/glyph-clipping-fixes: 2/2] Fix glyph cache entry sizing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/glyph-clipping-fixes: 2/2] Fix glyph cache entry sizing
- Date: Fri, 17 Sep 2021 17:48:53 +0000 (UTC)
commit d962360fa0e218d0e9f6f48b214a2428cb730464
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 17 13:17:53 2021 -0400
Fix glyph cache entry sizing
The subpixel-positioned glyph extends on both sides.
gsk/ngl/gsknglglyphlibrary.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gsk/ngl/gsknglglyphlibrary.c b/gsk/ngl/gsknglglyphlibrary.c
index 8ddf1ab265..9c184ed0f7 100644
--- a/gsk/ngl/gsknglglyphlibrary.c
+++ b/gsk/ngl/gsknglglyphlibrary.c
@@ -290,9 +290,15 @@ gsk_ngl_glyph_library_add (GskNglGlyphLibrary *self,
pango_extents_to_pixels (&ink_rect, NULL);
if (key->xshift != 0)
- ink_rect.width++;
+ {
+ ink_rect.x -= 1;
+ ink_rect.width += 2;
+ }
if (key->yshift != 0)
- ink_rect.height++;
+ {
+ ink_rect.y -= 1;
+ ink_rect.height += 2;
+ }
width = (int) ceil (ink_rect.width * key->scale / 1024.0);
height = (int) ceil (ink_rect.height * key->scale / 1024.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]