[text] Do not ensure the cursor if not needed
If the Text actor is neither editable nor has its cursor set to visible, then we should not be ensuring the cursor position. This fixes a failure in the conformance test unit for the layout cache.
This commit is contained in:
parent
c297d1ccf1
commit
368df450b2
@ -1030,12 +1030,13 @@ clutter_text_paint (ClutterActor *self)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_text_ensure_cursor_position (text);
|
|
||||||
|
|
||||||
clutter_actor_get_allocation_box (self, &alloc);
|
clutter_actor_get_allocation_box (self, &alloc);
|
||||||
layout = clutter_text_create_layout (text, alloc.x2 - alloc.x1);
|
layout = clutter_text_create_layout (text, alloc.x2 - alloc.x1);
|
||||||
|
|
||||||
if (priv->single_line_mode)
|
if (priv->editable && priv->cursor_visible)
|
||||||
|
clutter_text_ensure_cursor_position (text);
|
||||||
|
|
||||||
|
if (priv->editable && priv->single_line_mode)
|
||||||
{
|
{
|
||||||
PangoRectangle logical_rect = { 0, };
|
PangoRectangle logical_rect = { 0, };
|
||||||
gint actor_width, text_width;
|
gint actor_width, text_width;
|
||||||
|
Loading…
Reference in New Issue
Block a user