[glabels] Handle zoom-to-fit properly for unrealized view
- From: Jim Evins <jimevins src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glabels] Handle zoom-to-fit properly for unrealized view
- Date: Sat, 26 Dec 2009 17:37:39 +0000 (UTC)
commit b0fcb9d96c1719d1841294dc76f81893c600ace9
Author: Jim Evins <evins snaught com>
Date: Sat Dec 26 12:34:00 2009 -0500
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.
src/view.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/view.c b/src/view.c
index 6e742f6..064576d 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]