mirror of
https://github.com/csete/gpredict
synced 2026-08-13 17:39:46 -04:00
Update canvas bounds when resizing the canvas.
git-svn-id: https://gpredict.svn.sourceforge.net/svnroot/gpredict/trunk@188 ab6734ba-2843-0410-b83b-99c217ef6c0f
This commit is contained in:
parent
86a6e32050
commit
2954c2613d
1 changed files with 6 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue