[gimp] Bug 570353 – first time open of .svg file ignores the requested units



commit c78f7d1382ed1b717a7168a883f6ecb1455aa6bf
Author: Massimo Valentini <sixtysix inwind it>
Date:   Mon Jul 20 23:04:41 2009 +0200

    Bug 570353 â?? first time open of .svg file ignores the requested units
    
    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 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c
index 7646ab4..1403783 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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]