[mutter/gbsneto/paint-nodes: 1/2] clutter/paint-nodes: Use texture position to draw pango layout
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/paint-nodes: 1/2] clutter/paint-nodes: Use texture position to draw pango layout
- Date: Thu, 27 Sep 2018 22:42:26 +0000 (UTC)
commit cc75fc88ee8939bab6951a67ed514b93fb457e26
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Sep 25 16:48:35 2018 -0300
clutter/paint-nodes: Use texture position to draw pango layout
When painting a ClutterText, there are two different aspects that
should be taken into account:
1. The allocated size of the actor; and
2. The reported size of the PangoLayout, which may be smaller or
bigger than (1)
When (2) is bigger than (1), ClutterText has to clip the text to
only draw at the visible contents over the actor surface. In
addition to that, ClutterText also tracks the cursor position,
which makes clipping a bit more complicated.
The current ClutterTextNode.draw() implementation assumes that
the (1) also represents (2), which is not true. This makes
clipping not work.
Fix that by assuming that the position to draw the PangoLayout
is passed as the second rectangle, and the actor size is the
first one.
clutter/clutter/clutter-paint-nodes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c
index 3870ba663..aaea80b38 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -820,8 +820,8 @@ clutter_text_node_draw (ClutterPaintNode *node)
}
cogl_pango_render_layout (tnode->layout,
- op->op.texrect[0],
- op->op.texrect[1],
+ op->op.texrect[4],
+ op->op.texrect[5],
&tnode->color,
0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]