From: Jim Evins Date: Tue, 5 Feb 2008 02:03:08 +0000 (+0000) Subject: 2008-02-04 Jim Evins X-Git-Tag: glabels-2_3_0~274 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9e0bdc8ba7b36e33843fa7ba8baf496db7a41b88;p=glabels 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 --- 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);