Mercurial > MadButterfly
changeset 1227:983442b2698c
Fix the exception for object without opacity.
author | wycc |
---|---|
date | Fri, 07 Jan 2011 15:58:45 +0800 |
parents | bdc2ed94ea37 |
children | 027187a21117 |
files | pyink/tween.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pyink/tween.py Thu Jan 06 22:06:42 2011 +0800 +++ b/pyink/tween.py Fri Jan 07 15:58:45 2011 +0800 @@ -12,8 +12,12 @@ return float(f[1]) return 1 -def change_opacity(obj,opacity): - style = obj.getAttribute("style") +def change_opacity(obj, opacity): + try: + style = obj.getAttribute("style") + except: + obj.setAttribute("style","opacity:%g" % opacity) + return arr = style.split(';') s='' for a in arr: