From c78f7d1382ed1b717a7168a883f6ecb1455aa6bf Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Mon, 20 Jul 2009 23:04:41 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20570353=20=E2=80=93=20first=20time=20open?= =?UTF-8?q?=20of=20.svg=20file=20ignores=20the=20requested=20units?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resolution used to convert the sizes between pixels and units was only set initially and never updated. --- plug-ins/common/file-svg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c index 7646ab4fac..1403783ef7 100644 --- a/plug-ins/common/file-svg.c +++ b/plug-ins/common/file-svg.c @@ -649,6 +649,19 @@ load_dialog_resolution_callback (GimpSizeEntry *res, if (!load_rsvg_size (filename, &vals, NULL)) return; + g_signal_handlers_block_by_func (size, load_dialog_size_callback, NULL); + + gimp_size_entry_set_resolution (size, 0, load_vals.resolution, FALSE); + gimp_size_entry_set_resolution (size, 1, load_vals.resolution, FALSE); + + g_signal_handlers_unblock_by_func (size, load_dialog_size_callback, NULL); + + if (gimp_size_entry_get_unit (size) != GIMP_UNIT_PIXEL) + { + ratio_x = gimp_size_entry_get_refval (size, 0) / vals.width; + ratio_y = gimp_size_entry_get_refval (size, 1) / vals.height; + } + svg_width = vals.width; svg_height = vals.height;