GNOME Bugzilla – Bug 575740
[clutter] places slot background over cards from overlapping slots
Last modified: 2014-12-07 19:11:42 UTC
Please describe the problem: Some solitaires (ex. Thirteen, Escalator) don't move empty spaces to backward. In this case the solitaire works fine, but the picture isn't correct. Steps to reproduce: 1. Make moves, where cards should disappear, but the view of empty space must be left (ex. Klondike isn't good example, because it doesn't have empty spaces after cards) Actual results: http://img18.imageshack.us/img18/4686/29482420.png Expected results: http://img201.imageshack.us/img201/2805/73488802.png Does this happen every time? Yes Other information: This happen only with Clutter version of solitaire:
I think it is related to the way of hiding the cards: 1. If card's Actor is redrawn (to empty picture), it isn't placed to backward. 2. If there are two Actors (Card and Empty), they are having the same order in Z-Axis. When card's Actor is erased, the Empty actor is left. In the second case empty actors should be drawn first, and card next. I'm not still sure about cause of the problem, because I don't understand Aisleriot's sources well.
This should be a trivial fix by simply pushing any rendering of an empty space to the bottom of the z-axis. This is a single line of code. I will look at it.
commit decad2f0d9acc4637c79e2b4f04dff98cdc41166 Author: Jason D. Clinton <me@jasonclinton.com> Date: Sat Sep 26 23:28:57 2009 -0500 aisleriot: resolve z-order for empty slots; handles selection case (#575740) diff --git a/aisleriot/board.c b/aisleriot/board.c index af5119e..24a6c95 100644 --- a/aisleriot/board.c +++ b/aisleriot/board.c @@ -985,6 +985,15 @@ check_animations_cb (gpointer user_data) animations->len, (const AisleriotAnimStart *) animations->data, n_unexposed_animated_cards); + if (slot->cards->len == 0) { + clutter_actor_lower_bottom (slot->slot_renderer); + clutter_actor_lower_bottom (priv->baize_actor); + } else { + clutter_actor_raise_top (slot->slot_renderer); + ClutterActor *animation_layer = CLUTTER_ACTOR(aisleriot_slot_renderer_get_animation_layer(AISLERIOT_SLOT_RENDERER(slot->slot_renderer))); + clutter_actor_raise_top (animation_layer); + } + /* Set the old cards back to the new cards */ aisleriot_game_reset_old_cards (slot); } @@ -1288,7 +1297,7 @@ drag_end (AisleriotBoard *board, priv->moving_cards->data, priv->moving_cards->len); clutter_actor_raise_top (priv->moving_cards_origin_slot->slot_renderer); - ClutterActor *animation_layer = aisleriot_slot_renderer_get_animation_layer(priv->moving_cards_origin_slot->slot_renderer); + ClutterActor *animation_layer = CLUTTER_ACTOR(aisleriot_slot_renderer_get_animation_layer(AISLERIOT_SLOT_RENDERER(priv->moving_cards_origin_slot->slot_renderer))); clutter_actor_raise_top (animation_layer); } commit 7d6d61c88cd4ffbd430116cf9df84d77e508e2b4 Author: Jason D. Clinton <me@jasonclinton.com> Date: Sat Sep 26 21:26:57 2009 -0500 aisleriot: partial fix for z-order of empty slots; handles drag case (#575740) diff --git a/aisleriot/board.c b/aisleriot/board.c index 02600ed..bf44528 100644 --- a/aisleriot/board.c +++ b/aisleriot/board.c @@ -1268,6 +1268,11 @@ drag_begin (AisleriotBoard *board) clutter_container_add (CLUTTER_CONTAINER (stage), priv->moving_cards_group, NULL); + if (hslot->cards->len == 0) { + clutter_actor_lower_bottom (hslot->slot_renderer); + clutter_actor_lower_bottom (priv->baize_actor); + } + set_cursor (board, CURSOR_CLOSED); } @@ -1292,6 +1297,9 @@ drag_end (AisleriotBoard *board, priv->moving_cards_origin_slot, priv->moving_cards->data, priv->moving_cards->len); + clutter_actor_raise_top (priv->moving_cards_origin_slot->slot_renderer); + ClutterActor *animation_layer = aisleriot_slot_renderer_get_animation_layer(priv->moving_cards_origin_slot->slot_renderer); + clutter_actor_raise_top (animation_layer); } priv->click_status = STATUS_NONE;
Reopening; this isn't completely fixed. This is still visible in e.g. elevator, *while* the card flipping animation is running.
Also, when you clear more that just the lowest row of cards, you see that the slot backgrounds are now stacked in the wrong order: the lowest row is below the 2nd-lowest row, but it should be above it.
Mass-moving only open aisleriot bugs to the new product. Search for "aisleriot-mass-move" to filter them.