From 70ae1974aed8233b3ddf56987d2b39c14f49eec9 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Mon, 16 Feb 2004 22:03:47 +0000 Subject: [PATCH] 2004-02-16 Jim Evins * src/xml-label-04.c: (xml04_parse_image_props): * src/xml-label-191.c: (xml191_parse_image_props): * src/xml-label.c: (xml_parse_object_image): Delay setting image size until after image has been applied to new object. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@416 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 8 ++++++++ glabels2/src/xml-label-04.c | 8 ++++---- glabels2/src/xml-label-191.c | 2 +- glabels2/src/xml-label.c | 10 +++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index a5eae24c..e03e6556 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2004-02-16 Jim Evins + + * src/xml-label-04.c: (xml04_parse_image_props): + * src/xml-label-191.c: (xml191_parse_image_props): + * src/xml-label.c: (xml_parse_object_image): + Delay setting image size until after image has been applied to new + object. + 2004-02-15 Jim Evins * src/label-barcode.c: (gl_label_barcode_set_data), diff --git a/glabels2/src/xml-label-04.c b/glabels2/src/xml-label-04.c index 152457dc..3da7fc20 100644 --- a/glabels2/src/xml-label-04.c +++ b/glabels2/src/xml-label-04.c @@ -392,16 +392,16 @@ xml04_parse_image_props (xmlNodePtr node, gl_debug (DEBUG_XML, "START"); - w = gl_xml_get_prop_double (node, "w", 0); - h = gl_xml_get_prop_double (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - filename = g_new0 (glTextNode, 1); filename->field_flag = FALSE; filename->data = xmlGetProp (node, "filename"); gl_label_image_set_filename (object, filename); gl_text_node_free (&filename); + w = gl_xml_get_prop_double (node, "w", 0); + h = gl_xml_get_prop_double (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + gl_debug (DEBUG_XML, "END"); } diff --git a/glabels2/src/xml-label-191.c b/glabels2/src/xml-label-191.c index 87d0c50b..24ecab00 100644 --- a/glabels2/src/xml-label-191.c +++ b/glabels2/src/xml-label-191.c @@ -488,8 +488,8 @@ xml191_parse_image_props (xmlNodePtr node, } } - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); gl_text_node_free (&filename); diff --git a/glabels2/src/xml-label.c b/glabels2/src/xml-label.c index c08394ae..d90c89e9 100644 --- a/glabels2/src/xml-label.c +++ b/glabels2/src/xml-label.c @@ -626,11 +626,6 @@ xml_parse_object_image (xmlNodePtr node, y = gl_xml_get_prop_length (node, "y", 0.0); gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - /* size attrs */ - w = gl_xml_get_prop_length (node, "w", 0); - h = gl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - /* src or field attr */ string = xmlGetProp (node, "src"); if ( string ) { @@ -652,6 +647,11 @@ xml_parse_object_image (xmlNodePtr node, } } + /* size attrs */ + w = gl_xml_get_prop_length (node, "w", 0); + h = gl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + /* affine attrs */ affine[0] = gl_xml_get_prop_double (node, "a0", 0.0); affine[1] = gl_xml_get_prop_double (node, "a1", 0.0); -- 2.39.5