[gtk/subpixel-positioning: 5/5] gl: Pass full y position when picking glyphs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/subpixel-positioning: 5/5] gl: Pass full y position when picking glyphs
- Date: Sat, 27 Jul 2019 13:32:45 +0000 (UTC)
commit a73914719559e99c876dd60194341e39b210ae43
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 27 09:27:57 2019 -0400
gl: Pass full y position when picking glyphs
This lets us pick the right subpixel glyph.
The previous code was always pretending that
the baseline ends up on a pixel boundary.
But that is not the case anymore.
gsk/gl/gskglrenderer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index f64f1c435f..6c1316d910 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -595,8 +595,8 @@ render_text_node (GskGLRenderer *self,
gsk_gl_glyph_cache_lookup (self->glyph_cache,
(PangoFont *)font,
gi->glyph,
- x_position + gi->geometry.x_offset,
- gi->geometry.y_offset,
+ x * PANGO_SCALE + x_position + gi->geometry.x_offset,
+ y * PANGO_SCALE + gi->geometry.y_offset,
text_scale,
&glyph);
@@ -610,8 +610,8 @@ render_text_node (GskGLRenderer *self,
gsk_gl_glyph_cache_get_texture (self->gl_driver,
(PangoFont *)font,
gi->glyph,
- x_position + gi->geometry.x_offset,
- gi->geometry.y_offset,
+ x * PANGO_SCALE + x_position + gi->geometry.x_offset,
+ y * PANGO_SCALE + gi->geometry.y_offset,
text_scale,
&glyph);
g_assert (glyph.texture_id != 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]