Mercurial > MadButterfly
comparison pyink/domview.py @ 1276:0442ae9c2ac2
Fix bug of max frame of domview.
- old implementation does not consider condition about undo.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 12 Jan 2011 22:15:06 +0800 |
parents | 776b024ae8f9 |
children | 434f588fcde4 |
comparison
equal
deleted
inserted
replaced
1275:776b024ae8f9 | 1276:0442ae9c2ac2 |
---|---|
157 if new_value: | 157 if new_value: |
158 self._group2scene[new_value] = node | 158 self._group2scene[new_value] = node |
159 pass | 159 pass |
160 pass | 160 pass |
161 elif (name in ('start', 'end')) and node.name() == 'ns0:scene': | 161 elif (name in ('start', 'end')) and node.name() == 'ns0:scene': |
162 self._maxframe = max(int(new_value), self._maxframe) | 162 try: |
163 new_value = int(new_value) | |
164 old_value = int(old_value) | |
165 except TypeError: | |
166 scenes_node = node.parent() | |
167 self._maxframe = self._find_maxframe(scenes_node) | |
168 else: | |
169 if old_value == self._maxframe and old_value > new_value: | |
170 # _maxframe may be reduced. | |
171 scenes_node = node.parent() | |
172 self._maxframe = self._find_maxframe(scenes_node) | |
173 else: | |
174 self._maxframe = max(int(new_value), self._maxframe) | |
175 pass | |
176 pass | |
163 pass | 177 pass |
164 pass | 178 pass |
165 | 179 |
166 ## \brief Collect ID of nodes in the document. | 180 ## \brief Collect ID of nodes in the document. |
167 # | 181 # |