From 2954c2613dbe668010cb8ea9b91c425db8972182 Mon Sep 17 00:00:00 2001 From: csete Date: Sun, 28 Dec 2008 14:53:15 +0000 Subject: [PATCH] Update canvas bounds when resizing the canvas. git-svn-id: https://gpredict.svn.sourceforge.net/svnroot/gpredict/trunk@188 ab6734ba-2843-0410-b83b-99c217ef6c0f --- src/gtk-polar-view.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gtk-polar-view.c b/src/gtk-polar-view.c index 0fc15d8..c3c2c84 100644 --- a/src/gtk-polar-view.c +++ b/src/gtk-polar-view.c @@ -232,11 +232,9 @@ gtk_polar_view_new (GKeyFile *cfgdata, GHashTable *sats, qth_t *qth) gtk_widget_modify_base (GTK_POLAR_VIEW (polv)->canvas, GTK_STATE_NORMAL, &bg_color); gtk_widget_set_size_request (GTK_POLAR_VIEW (polv)->canvas, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); - /* if we set canvas bounds resize will cut the image to this size - discovered with GooCanvas 0.12 goo_canvas_set_bounds (GOO_CANVAS (GTK_POLAR_VIEW (polv)->canvas), 0, 0, POLV_DEFAULT_SIZE, POLV_DEFAULT_SIZE); - */ + /* connect size-request signal */ g_signal_connect (GTK_POLAR_VIEW (polv)->canvas, "size-allocate", @@ -521,6 +519,11 @@ size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data) polv->cx = allocation->width / 2; polv->cy = allocation->height / 2; + /* update canvas bounds to match new size */ + goo_canvas_set_bounds (GOO_CANVAS (GTK_POLAR_VIEW (polv)->canvas), 0, 0, + allocation->width, allocation->height); + + /* update coordinate system */ g_object_set (polv->C00, "center-x", (gdouble) polv->cx,