sugarlabs / sugar-toolkit-gtk3

Sugar Learning Environment, Activity Toolkit, GTK 3.
GNU Lesser General Public License v2.1
21 stars 80 forks source link

Animator do_stop api #336

Closed samdroid-apps closed 8 years ago

samdroid-apps commented 8 years ago

This adds a explicit method for cleaning up the animation. Previously, animations expected the next_frame to be called where frame=end.

That guarantee was never provided by the api. This resulted in animations sometimes being in odd states. For example, Browse activity had an animation that overrode the Gtk "draw" signal. If the signal was not unbound, the animated object was mistakenly rendered after the completion of the animation, obstructing the user's view.

This api is explicit and allows cleaner code in the animation implementation. The clean up code goes in do_stop rather than in a conditional of next_frame.