StBoxLayout: remove an incorrect drawing optimization

Paint/pick all children, regardless of whether or not they lie within
the content_box. The previous behavior was that a child that was 99%
outside the box would be fully visible, but a child that was 100%
outside the box would be fully hidden. This is somewhat odd, and
doesn't match the behavior of the other St container classes, and at
any rate, the use of clutter_actor_get_allocation_box() for this
optimization was incorrect since it doesn't take into account
transformations (anchor point, rotation, etc) that might cause the
child to be drawn within the content_box anyway.

(For scrolled StBoxLayouts, drawing is still clipped to the
content_box, as before, but will now properly take transformations
into account as well.)

https://bugzilla.gnome.org/show_bug.cgi?id=614047
This commit is contained in:
Dan Winship 2010-03-26 15:09:38 -04:00
parent b9e58947cc
commit 1dd4c7140e

View File

@ -940,7 +940,6 @@ st_box_layout_paint (ClutterActor *actor)
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
GList *l; GList *l;
gdouble x, y; gdouble x, y;
ClutterActorBox child_box;
ClutterActorBox allocation_box; ClutterActorBox allocation_box;
ClutterActorBox content_box; ClutterActorBox content_box;
@ -993,18 +992,8 @@ st_box_layout_paint (ClutterActor *actor)
{ {
ClutterActor *child = (ClutterActor*) l->data; ClutterActor *child = (ClutterActor*) l->data;
if (!CLUTTER_ACTOR_IS_VISIBLE (child)) if (CLUTTER_ACTOR_IS_VISIBLE (child))
continue; clutter_actor_paint (child);
clutter_actor_get_allocation_box (child, &child_box);
if ((child_box.x1 < content_box.x2) &&
(child_box.x2 > content_box.x1) &&
(child_box.y1 < content_box.y2) &&
(child_box.y2 > content_box.y1))
{
clutter_actor_paint (child);
}
} }
if (priv->hadjustment || priv->vadjustment) if (priv->hadjustment || priv->vadjustment)
@ -1019,7 +1008,6 @@ st_box_layout_pick (ClutterActor *actor,
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor)); StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
GList *l; GList *l;
gdouble x, y; gdouble x, y;
ClutterActorBox child_box;
ClutterActorBox allocation_box; ClutterActorBox allocation_box;
ClutterActorBox content_box; ClutterActorBox content_box;
@ -1067,18 +1055,8 @@ st_box_layout_pick (ClutterActor *actor,
{ {
ClutterActor *child = (ClutterActor*) l->data; ClutterActor *child = (ClutterActor*) l->data;
if (!CLUTTER_ACTOR_IS_VISIBLE (child)) if (CLUTTER_ACTOR_IS_VISIBLE (child))
continue; clutter_actor_paint (child);
clutter_actor_get_allocation_box (child, &child_box);
if ((child_box.x1 < content_box.x2) &&
(child_box.x2 > content_box.x1) &&
(child_box.y1 < content_box.y2) &&
(child_box.y2 > content_box.y1))
{
clutter_actor_paint (child);
}
} }
if (priv->hadjustment || priv->vadjustment) if (priv->hadjustment || priv->vadjustment)