[dia] transparency: fix diasvg_import.py to read colors again



commit 8917a7ed0a7a03e7d517b0ff055c3a2d4b05fc09
Author: Hans Breuer <hans breuer org>
Date:   Sun Jan 19 12:10:52 2014 +0100

    transparency: fix diasvg_import.py to read colors again
    
    This is reverting this files changes by the big commit
    Bug #591525 - Transparent objects by adding alpha to Color structure
    b8994a3489256de6baaabaf09a7cf69f39390353, which actually had two issues:
    
     - transparency in SVG is not represented by quadlets like #rrggbbaa
     - even if it would: a mismatch of the regex should have led to the
       fallback interpretation but was producing an exception instead

 plug-ins/python/diasvg_import.py |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/python/diasvg_import.py b/plug-ins/python/diasvg_import.py
index 3aafa96..a7065f1 100644
--- a/plug-ins/python/diasvg_import.py
+++ b/plug-ins/python/diasvg_import.py
@@ -38,7 +38,6 @@ dictUnitScales = {
 
 # only compile once
 rColor = re.compile(r"rgb\s*\(\s*(\d+)[, ]+(\d+)[, +](\d+)\s*\)")
-rColora = re.compile(r"rgba\s*\(\s*(\d+)[, ]+(\d+)[, +](\d+)[, +](\d+)\s*\)")
 # not really parsing numbers (Scaled will deal with more)
 rTranslate = re.compile(r"translate\s*\(\s*([^,]+),([^)]+)\s*\)")
 #FIXME: parse more - e.g. AQT - of the strange path data
@@ -70,9 +69,6 @@ def Color(s) :
        m = rColor.match(s)
        if m :
                return (int(m.group(1)) / 255.0, int(m.group(2)) / 255.0, int(m.group(3)) / 255.0, 1.0)
-       else:
-               m = rColora.match(s)
-               return (int(m.group(1)) / 255.0, int(m.group(2)) / 255.0, int(m.group(3)) / 255.0, 
int(m.group(4)) / 255.0)
        # any more ugly color definitions not compatible with pango_color_parse() ?
        return string.strip(s)
 def _eval (s, _locals) :


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