fix some bugs in go to frame

This commit is contained in:
Skyler Lehmkuhl 2024-12-18 19:08:21 -05:00
parent c7c2cd3744
commit 7ab61ac77d
1 changed files with 5 additions and 1 deletions

View File

@ -112,6 +112,8 @@ let tools = {
if (context.selection.length != 1) return undefined if (context.selection.length != 1) return undefined
const selectedObject = context.selection[0] const selectedObject = context.selection[0]
context.activeObject.currentFrame.keys[selectedObject.idx].goToFrame = val context.activeObject.currentFrame.keys[selectedObject.idx].goToFrame = val
selectedObject.setFrameNum(val-1)
updateUI()
} }
} }
}, },
@ -1884,7 +1886,8 @@ class GraphicsObject {
return this.activeLayer.getFrame(num) return this.activeLayer.getFrame(num)
} }
setFrameNum(num) { setFrameNum(num) {
this.currentFrameNum = Math.max(0, Math.min(this.maxFrame, num)) // this.currentFrameNum = Math.max(0, Math.min(this.maxFrame, num))
this.currentFrameNum = Math.max(0, num)
if (this.currentFrame.frameType=="keyframe") { if (this.currentFrame.frameType=="keyframe") {
for (let child of this.children) { for (let child of this.children) {
if (this.currentFrame.keys[child.idx].goToFrame != undefined) { if (this.currentFrame.keys[child.idx].goToFrame != undefined) {
@ -3896,6 +3899,7 @@ function updateLayers() {
updateLayers() updateLayers()
updateMenu() updateMenu()
updateUI() updateUI()
updateInfopanel()
}) })
let highlightedFrame = false let highlightedFrame = false
layer.frames.forEach((frame, i) => { layer.frames.forEach((frame, i) => {