From 7c18b025735e7945b00a810c9f4d6275386d8eb1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 13 Oct 2011 02:38:11 -0700 Subject: board: Don't use sealed variables --- src/gnome/gnome-board.c | 10 ++++++---- 1 file 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 -- cgit v1.2.3