[gtk/wip/matthiasc/gl-icon-cache: 5/9] glyph cache: Reinstate 1 pixel padding



commit d665d11494ffdd9423116cd9b04e4f36e96cdaf6
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 2 16:02:31 2019 +0000

    glyph cache: Reinstate 1 pixel padding
    
    This is necessary to prevent bleeding.

 gsk/gl/gskglglyphcache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index ad20a8fa9b..0b5e5edf2b 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -158,14 +158,14 @@ add_to_cache (GskGLGlyphCache  *cache,
       g_ptr_array_add (cache->atlases, atlas);
 
       was_packed = gsk_gl_texture_atlas_pack (atlas,
-                                              width, height,
+                                              width + 2, height + 2,
                                               &packed_x, &packed_y);
 
       g_assert (was_packed);
     }
 
-  value->tx = (float)packed_x / atlas->width;
-  value->ty = (float)packed_y / atlas->height;
+  value->tx = (float)(packed_x + 1) / atlas->width;
+  value->ty = (float)(packed_y + 1) / atlas->height;
   value->tw = (float)width    / atlas->width;
   value->th = (float)height   / atlas->height;
   value->used = TRUE;


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