From 9e0bdc8ba7b36e33843fa7ba8baf496db7a41b88 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Tue, 5 Feb 2008 02:03:08 +0000 Subject: [PATCH] 2008-02-04 Jim Evins * src/view-image.c: (update_object_from_editor_cb): Bug #1886438. Don't update the image size unless it is actually triggered by a change in image source. The result of this bug was that any attempt to edit the size spinboxes, immediately reset the size. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@746 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 8 ++++++++ glabels2/src/view-image.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 1f6031a1..5c032149 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2008-02-04 Jim Evins + + * src/view-image.c: (update_object_from_editor_cb): + Bug #1886438. Don't update the image size unless it is actually + triggered by a change in image source. The result of this bug + was that any attempt to edit the size spinboxes, immediately + reset the size. + 2008-02-03 Jim Evins * src/label-image.c: (gl_label_image_class_init), (set_size): diff --git a/glabels2/src/view-image.c b/glabels2/src/view-image.c index 8e72241c..7612284d 100644 --- a/glabels2/src/view-image.c +++ b/glabels2/src/view-image.c @@ -206,6 +206,7 @@ update_object_from_editor_cb (glObjectEditor *editor, glTextNode *filename; const GdkPixbuf *pixbuf; gdouble image_w, image_h; + gdouble new_w, new_h; gl_debug (DEBUG_VIEW, "START"); @@ -228,8 +229,11 @@ update_object_from_editor_cb (glObjectEditor *editor, gl_text_node_free (&filename); /* Setting filename may have modified the size. */ - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); + gl_label_object_get_size (object, &new_w, &new_h); + if ( (new_w != w) || (new_h != h) ) + { + gl_object_editor_set_size (editor, new_w, new_h); + } /* It may also have a new base size. */ pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL); -- 2.39.5