fix a few errors

This commit is contained in:
Skyler Lehmkuhl 2025-01-23 05:23:26 -05:00
parent f88c1f1408
commit 139aedd5de
1 changed files with 30 additions and 23 deletions

View File

@ -93,7 +93,7 @@ function forwardConsole(fnName, dest) {
const stackLines = error.stack.split("\n");
let message = args.join(" "); // Join all arguments into a single string
const location = stackLines[1].match(/([a-zA-Z0-9_-]+\.js:\d+)/);
const location = stackLines.length>1 ? stackLines[1].match(/([a-zA-Z0-9_-]+\.js:\d+)/) : stackLines.toString();
if (fnName === "error") {
// Send the full stack trace for errors
@ -1322,6 +1322,7 @@ let actions = {
for (let frameObj of action.selectedFrames) {
let layer = object.layers[frameObj.layer];
let frame = layer.frames[frameObj.frameNum];
if (frameObj) {
frameBuffer.push({
frame: frame,
frameNum: frameObj.frameNum,
@ -1329,6 +1330,7 @@ let actions = {
});
layer.deleteFrame(frame.idx, undefined, frameObj.replacementUuid);
}
}
for (let frameObj of frameBuffer) {
const layer_idx = frameObj.layer + action.offset.layers;
let layer = object.layers[layer_idx];
@ -1443,6 +1445,7 @@ let actions = {
let serializableShapes = [];
let serializableObjects = [];
let bbox;
const frame = context.activeObject.currentFrame
for (let shape of context.shapeselection) {
serializableShapes.push(shape.idx);
if (bbox == undefined) {
@ -1452,6 +1455,7 @@ let actions = {
}
}
for (let object of context.selection) {
if (object.idx in frame.keys) {
serializableObjects.push(object.idx);
// TODO: rotated bbox
if (bbox == undefined) {
@ -1460,6 +1464,7 @@ let actions = {
growBoundingBox(bbox, object.bbox());
}
}
}
context.shapeselection = [];
context.selection = [];
let action = {
@ -1467,7 +1472,7 @@ let actions = {
objects: serializableObjects,
groupUuid: uuidv4(),
parent: context.activeObject.idx,
frame: context.activeObject.currentFrame.idx,
frame: frame.idx,
layer: context.activeObject.activeLayer.idx,
position: {
x: (bbox.x.min + bbox.x.max) / 2,
@ -2632,7 +2637,6 @@ class Layer extends Widget {
ctx.setTransform(transform)
}
}
}
if (this.activeShape) {
this.activeShape.draw(cxt)
}
@ -2643,6 +2647,7 @@ class Layer extends Widget {
}
}
}
}
bbox() {
let bbox = super.bbox()
const frameInfo = this.getFrameValue(this.frameNum);
@ -4111,9 +4116,11 @@ class GraphicsObject extends Widget {
for (let layer of this.layers) {
layer.children = layer.children.filter(child => child.idx !== idx);
for (let frame of layer.frames) {
if (frame) {
delete frame[idx];
}
}
}
// this.children.splice(this.children.indexOf(childObject), 1);
}
addLayer(layer) {