From e13c92f66190b62045a98e9b6cb3a66fd09393c5 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 23 Jan 2025 05:41:07 -0500 Subject: [PATCH 1/5] Fix clicking on layers bug --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index ef475c0..c375fee 100644 --- a/src/main.js +++ b/src/main.js @@ -3763,7 +3763,7 @@ class GraphicsObject extends Widget { this.setFrameNum(this.currentFrameNum - 1); } getFrame(num) { - return this.activeLayer.getFrame(num); + return this.activeLayer?.getFrame(num); } setFrameNum(num) { num = Math.max(0, num); @@ -6543,7 +6543,7 @@ function timeline() { updateUI(); updateMenu(); } else { - context.activeObject.currentLayer = i; + context.activeObject.currentLayer = i - context.activeObject.audioLayers.length; } } } From 1bfacd6b113cdb16f3866662d5e440caf45665ab Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 23 Jan 2025 16:25:51 -0500 Subject: [PATCH 2/5] Fix "frame deleting" issue --- src/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index c375fee..565aab6 100644 --- a/src/main.js +++ b/src/main.js @@ -1297,6 +1297,7 @@ let actions = { const selectedFrames = structuredClone(context.selectedFrames); for (let frame of selectedFrames) { frame.replacementUuid = uuidv4(); + frame.layer = context.activeObject.layers.length - frame.layer - 1; } // const fillFrames = [] // for (let i=0; i { - let mouse = getMousePos(timeline_cvs, e); + let mouse = getMousePos(timeline_cvs, e, true, true); mouse.y += timeline_cvs.offsetY; if (mouse.x > layerWidth || timeline_cvs.draggingFrames) { mouse.x += timeline_cvs.offsetX - layerWidth; @@ -6570,7 +6572,7 @@ function timeline() { } }); timeline_cvs.addEventListener("pointermove", (e) => { - let mouse = getMousePos(timeline_cvs, e); + let mouse = getMousePos(timeline_cvs, e, true, true); mouse.y += timeline_cvs.offsetY; if (mouse.x > layerWidth || timeline_cvs.draggingFrames) { mouse.x += timeline_cvs.offsetX - layerWidth; From ca69813a5c525c53eb7b5591eeae1caff31dd193 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 23 Jan 2025 16:26:19 -0500 Subject: [PATCH 3/5] Make moving frames undoable --- src/main.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 565aab6..9416375 100644 --- a/src/main.js +++ b/src/main.js @@ -1343,7 +1343,27 @@ let actions = { updateUI(); }, rollback: (action) => { - // your code here + const object = pointerList[action.object]; + const frameBuffer = []; + for (let frameObj of action.selectedFrames) { + let layer = object.layers[frameObj.layer]; + let frame = layer.frames[frameObj.frameNum + action.offset.frames]; + if (frameObj) { + frameBuffer.push({ + frame: frame, + frameNum: frameObj.frameNum, + layer: frameObj.layer, + }); + layer.deleteFrame(frame.idx, "none") + } + } + for (let frameObj of frameBuffer) { + let layer = object.layers[frameObj.layer]; + let frame = frameObj.frame; + if (frameObj) { + layer.addFrame(frameObj.frameNum, frame, []) + } + } }, }, addMotionTween: { From 065e6eb99e4fbdcf8ddea660e6302e0faa88f8a0 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 23 Jan 2025 16:41:00 -0500 Subject: [PATCH 4/5] Show wait cursor while loading a file --- src/main.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 9416375..475b157 100644 --- a/src/main.js +++ b/src/main.js @@ -4492,6 +4492,7 @@ async function saveAs() { } async function _open(path, returnJson = false) { + document.body.style.cursor = "wait" closeDialog(); try { const contents = await readTextFile(path); @@ -4501,6 +4502,7 @@ async function _open(path, returnJson = false) { title: "Load error", kind: "error", }); + document.body.style.cursor = "default" return; } if (file.version >= minFileVersion) { @@ -4511,6 +4513,7 @@ async function _open(path, returnJson = false) { "Could not import from this file. Re-save it with a current version of Lightningbeam.", ); } + document.body.style.cursor = "default" return file.json; } else { _newFile(file.width, file.height, file.fps); @@ -4519,6 +4522,7 @@ async function _open(path, returnJson = false) { title: "Parse error", kind: "error", }); + document.body.style.cursor = "default" return; } @@ -4531,6 +4535,7 @@ async function _open(path, returnJson = false) { `Invalid action ${action.name}. File may be corrupt.`, { title: "Error", kind: "error" }, ); + document.body.style.cursor = "default" return; } @@ -4735,6 +4740,7 @@ async function _open(path, returnJson = false) { ); } } + document.body.style.cursor = "default" } async function open() { @@ -4751,7 +4757,8 @@ async function open() { }); console.log(path); if (path) { - _open(path); + document.body.style.cursor = "wait" + setTimeout(()=>_open(path),10); } } @@ -6770,7 +6777,8 @@ async function startup() { createNewFileDialog(_newFile, _open, config); if (!window.openedFiles?.length) { if (config.reopenLastSession && config.recentFiles?.length) { - _open(config.recentFiles[0]) + document.body.style.cursor = "wait" + setTimeout(()=>_open(config.recentFiles[0]), 10) } else { showNewFileDialog(config); } @@ -7908,7 +7916,8 @@ async function renderMenu() { text: file, enabled: true, action: () => { - _open(file); + document.body.style.cursor = "wait" + setTimeout(()=>_open(file),10); }, }); }); @@ -8393,7 +8402,8 @@ function renderAll() { renderAll(); if (window.openedFiles?.length>0) { - _open(window.openedFiles[0]) + document.body.style.cursor = "wait" + setTimeout(()=>_open(window.openedFiles[0]),10) for (let i=1; i Date: Thu, 23 Jan 2025 16:43:22 -0500 Subject: [PATCH 5/5] Bump version to 0.7.14-alpha --- Changelog.md | 9 +++++++++ src-tauri/tauri.conf.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 58497b8..af0e374 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,12 @@ +# 0.7.14-alpha: +Changes: +- Moving frames can now be undone +- A wait cursor is shown during file loading + +Bugfixes: +- Fix clicking on layers bug +- Fix "frame deleting" issue when clicking on frames in a scrolled timeline + # 0.7.13-alpha: Changes: - changed file MIME type from text/plain to application/lightningbeam to prevent editor woes on Linux diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e564eb6..1bb8b3f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Lightningbeam", - "version": "0.7.13-alpha", + "version": "0.7.14-alpha", "identifier": "org.lightningbeam.core", "build": { "frontendDist": "../src"