From: Jim Evins Date: Sat, 26 Dec 2009 17:34:00 +0000 (-0500) Subject: Handle zoom-to-fit properly for unrealized view X-Git-Tag: glabels-2_3_0~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b0fcb9d96c1719d1841294dc76f81893c600ace9;p=glabels Handle zoom-to-fit properly for unrealized view Delay calculations in gl_view_zoom_to_fit() if window has not been realized yet. Do calculations in realize callback. --- diff --git a/src/view.c b/src/view.c index 6e742f67..064576d5 100644 --- a/src/view.c +++ b/src/view.c @@ -548,6 +548,11 @@ realize_cb (glView *view) gl_debug (DEBUG_VIEW, "START"); + if (view->zoom_to_fit_flag) { + /* Maintain best fit zoom */ + gl_view_zoom_to_fit (view); + } + gl_debug (DEBUG_VIEW, "END"); } @@ -1170,7 +1175,8 @@ gl_view_zoom_to_fit (glView *view) gl_debug (DEBUG_VIEW, ""); if ( ! gtk_widget_get_window (GTK_WIDGET (view)) ) { - set_zoom_real (view, 1.0, TRUE); + /* Delay until realized. */ + view->zoom_to_fit_flag = TRUE; return; }