mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Method to remove codec event listeners
Switching modes no longer resets animation timeline selection
This commit is contained in:
parent
ab916f50ab
commit
c11638c738
@ -1215,8 +1215,11 @@ const Animator = {
|
||||
outlines.children.empty()
|
||||
Canvas.updateAllPositions()
|
||||
}
|
||||
if (Animator.animations.length) {
|
||||
Animator.animations[0].select()
|
||||
if (Animation.all.length && !Animation.all.includes(Animation.selected)) {
|
||||
Animation.all[0].select();
|
||||
}
|
||||
if (Group.selected) {
|
||||
Group.selected.select();
|
||||
}
|
||||
Animator.preview()
|
||||
},
|
||||
|
@ -114,6 +114,11 @@ class Codec {
|
||||
}
|
||||
this.events[event_name].safePush(cb)
|
||||
}
|
||||
removeListener(event_name, cb) {
|
||||
if (this.events[event_name]) {
|
||||
this.events[event_name].remove(cb);
|
||||
}
|
||||
}
|
||||
//Delete
|
||||
delete() {
|
||||
delete Codecs[this.id];
|
||||
|
Loading…
Reference in New Issue
Block a user