Mercurial > MadButterfly
changeset 1360:f89d3ee130de
Remove TweenObject._update_tween_style
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 16 Feb 2011 15:11:38 +0800 |
parents | 5313bbfafa67 |
children | cf5ed0b8f45d |
files | pyink/tween.py |
diffstat | 1 files changed, 2 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/pyink/tween.py Wed Feb 16 15:07:44 2011 +0800 +++ b/pyink/tween.py Wed Feb 16 15:11:38 2011 +0800 @@ -449,7 +449,7 @@ newobj.setAttribute("ref", s.getAttribute("id")) obj.appendChild(newobj) pass - self.update_tween_object_scale(s, d, p, newobj) + self._update_tween_object_scale(s, d, p, newobj) pass elif typ == self.TWEEN_TYPE_NORMAL and newobj == None: newobj = s.duplicate(self._doc) @@ -458,47 +458,7 @@ pass pass - def _update_tween_style(self, s, d, p, newobj): - if d.name() == 'svg:use': - return - try: - s_style = s.getAttribute('style') - except: - s_attrs = {} - else: - s_attrs = _parse_style(s_style) - pass - - try: - d_style = d.getAttribute('style') - except: - d_attrs = {} - else: - d_attrs = _parse_style(d_style) - pass - - attrs = dict(s_attrs) - - if s_attrs.has_key('opacity'): - start_opacity = float(s_attrs['opacity']) - else: - start_opacity = 1 - pass - - if d_attrs.has_key('opacity'): - end_opacity = float(d_attrs['opacity']) - else: - end_opacity = 1 - pass - - cur_opacity = start_opacity * (1 - p) + end_opacity * p - attrs['opacity'] = '%g' % (cur_opacity) - - new_style = _gen_style(attrs) - newobj.setAttribute('style', new_style) - pass - - def update_tween_object_scale(self, start, stop, percent, newobj): + def _update_tween_object_scale(self, start, stop, percent, newobj): start_attrs = {} _parse_style_ani(start, start_attrs) _parse_attr_ani(start, start_attrs)