mirror of
https://github.com/brl/mutter.git
synced 2024-12-22 19:12:04 +00:00
clutter/text: Invalidate actor paint volume when it has changed
ClutterText implements its own get_paint_volume() with its own cache, but was not invalidating the actor paint volume when when it has changed. This sometimes could result in labels, especially quickly changing ones, using the old paint volume which either would cut off the label or leave parts of the old label on screen. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1943 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2006>
This commit is contained in:
parent
a0a612f18f
commit
867db93043
@ -440,7 +440,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterText,
|
||||
clutter_animatable_iface_init));
|
||||
|
||||
static inline void
|
||||
clutter_text_dirty_paint_volume (ClutterText *text)
|
||||
clutter_text_free_paint_volume (ClutterText *text)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
|
||||
@ -451,6 +451,18 @@ clutter_text_dirty_paint_volume (ClutterText *text)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_text_dirty_paint_volume (ClutterText *text)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
|
||||
if (priv->paint_volume_valid)
|
||||
{
|
||||
clutter_text_free_paint_volume (text);
|
||||
clutter_actor_invalidate_paint_volume (CLUTTER_ACTOR (text));
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_text_queue_redraw (ClutterActor *self)
|
||||
{
|
||||
@ -1785,7 +1797,7 @@ clutter_text_finalize (GObject *gobject)
|
||||
if (priv->preedit_attrs)
|
||||
pango_attr_list_unref (priv->preedit_attrs);
|
||||
|
||||
clutter_text_dirty_paint_volume (self);
|
||||
clutter_text_free_paint_volume (self);
|
||||
|
||||
clutter_text_set_buffer (self, NULL);
|
||||
g_free (priv->font_name);
|
||||
|
Loading…
Reference in New Issue
Block a user