changeset 300:1b69da2494e9

Use the opacity of the style to overwrite the default opacity property of the node itself.
author wycc
date Sun, 15 Feb 2009 08:21:37 +0800
parents 5bf503270419
children c8173a65e384
files tools/svg2code.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/svg2code.py	Wed Feb 04 09:12:02 2009 +0800
+++ b/tools/svg2code.py	Sun Feb 15 08:21:37 2009 +0800
@@ -134,9 +134,16 @@
     try:
         opacity = float(node.getAttribute('opacity'))
     except:
-        opacity = 0.5
+        opacity = 1.0
         pass
 
+    try:
+	opacity = float(prop_map['opacity'])
+    except:
+	pass
+
+    print "# opacity of %s is %g" % (node_id, opacity)
+
     if prop_map.has_key('fill'):
         fill = prop_map['fill'].strip()
         if fill.startswith('#') and len(fill) == 7: