diff options
author | Benjamin Otte <otte@redhat.com> | 2011-10-13 02:38:11 -0700 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-10-14 00:31:16 -0700 |
commit | 7c18b025735e7945b00a810c9f4d6275386d8eb1 (patch) | |
tree | 97e5d3ccd9029f5c88750b082129da2abcc3b2cf | |
parent | 68f4dd0b03bf7fb0ac692476a35b1747d5006ca0 (diff) |
board: Don't use sealed variables
-rw-r--r-- | src/gnome/gnome-board.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gnome/gnome-board.c b/src/gnome/gnome-board.c index 7f25582..0a2c861 100644 --- a/src/gnome/gnome-board.c +++ b/src/gnome/gnome-board.c @@ -62,19 +62,21 @@ static void game_gnome_board_compute_window_size (GameGnomeBoard *board) { double w, h; - GtkAllocation *allocation = >K_WIDGET (board)->allocation; + GtkAllocation allocation; + + gtk_widget_get_allocation (GTK_WIDGET (board), &allocation); if (board->graphic) { game_gnome_board_get_graphic_size (board, &w, &h); - board->scale = MIN ((double) allocation->width / w, (double) allocation->height/ h); + board->scale = MIN ((double) allocation.width / w, (double) allocation.height / h); w = ceil (w * board->scale); h = ceil (h * board->scale); } else { board->scale = 1.0; w = h = 1; } - board->skip_x = (int) (allocation->width - w) / 2 + allocation->x; - board->skip_y = (int) (allocation->height - h) / 2 + allocation->y; + board->skip_x = (int) (allocation.width - w) / 2 + allocation.x; + board->skip_y = (int) (allocation.height - h) / 2 + allocation.y; } static void |