[Gpredict-svn] SF.net SVN: gpredict:[188] trunk/src/gtk-polar-view.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2008-12-28 14:53:23
|
Revision: 188 http://gpredict.svn.sourceforge.net/gpredict/?rev=188&view=rev Author: csete Date: 2008-12-28 14:53:15 +0000 (Sun, 28 Dec 2008) Log Message: ----------- Update canvas bounds when resizing the canvas. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2008-12-28 14:46:41 UTC (rev 187) +++ trunk/src/gtk-polar-view.c 2008-12-28 14:53:15 UTC (rev 188) @@ -232,12 +232,10 @@ 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", G_CALLBACK (size_allocate_cb), polv); @@ -521,6 +519,11 @@ 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, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |