text: Check the has_focus flag in selection_paint()

It is the only place were it is used, so it should only be checked
there, and not in the general paint() implementation.
This commit is contained in:
Emmanuele Bassi 2011-05-13 14:26:22 +01:00
parent 729e9985c1
commit ba4615cd4b

View File

@ -1384,6 +1384,9 @@ selection_paint (ClutterText *self)
ClutterActor *actor = CLUTTER_ACTOR (self);
guint8 paint_opacity = clutter_actor_get_paint_opacity (actor);
if (!priv->has_focus)
return;
if (priv->editable && priv->cursor_visible)
{
const ClutterColor *color;
@ -1965,8 +1968,7 @@ clutter_text_paint (ClutterActor *self)
real_opacity);
cogl_pango_render_layout (layout, text_x, 0, &color, 0);
if (priv->has_focus)
selection_paint (text);
selection_paint (text);
if (clip_set)
cogl_clip_pop ();