mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
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.
This commit is contained in:
parent
68ec9ac017
commit
cc75fc88ee
@ -820,8 +820,8 @@ clutter_text_node_draw (ClutterPaintNode *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cogl_pango_render_layout (tnode->layout,
|
cogl_pango_render_layout (tnode->layout,
|
||||||
op->op.texrect[0],
|
op->op.texrect[4],
|
||||||
op->op.texrect[1],
|
op->op.texrect[5],
|
||||||
&tnode->color,
|
&tnode->color,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user