@elixpo/lixsketch 4.6.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -358,10 +358,12 @@ export function loadScene(sceneData) {
|
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
360
|
|
|
361
|
-
|
|
361
|
+
// Clear arrays IN PLACE — tool modules hold direct references to these
|
|
362
|
+
// arrays from import-time, so replacing them breaks interactivity.
|
|
363
|
+
if (window.shapes) window.shapes.length = 0; else window.shapes = [];
|
|
362
364
|
window.currentShape = null;
|
|
363
|
-
window.historyStack = [];
|
|
364
|
-
window.redoStack = [];
|
|
365
|
+
if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];
|
|
366
|
+
if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];
|
|
365
367
|
|
|
366
368
|
// Build ID -> shape map for frame containment and arrow attachments
|
|
367
369
|
const idMap = new Map();
|
|
@@ -687,10 +689,11 @@ export function resetCanvas() {
|
|
|
687
689
|
'.selection-outline, .resize-anchor, .rotation-anchor, [data-selection]'
|
|
688
690
|
).forEach(el => el.remove());
|
|
689
691
|
|
|
690
|
-
|
|
692
|
+
// Clear arrays IN PLACE (same reason as loadScene)
|
|
693
|
+
if (window.shapes) window.shapes.length = 0; else window.shapes = [];
|
|
691
694
|
window.currentShape = null;
|
|
692
|
-
window.historyStack = [];
|
|
693
|
-
window.redoStack = [];
|
|
695
|
+
if (window.historyStack) window.historyStack.length = 0; else window.historyStack = [];
|
|
696
|
+
if (window.redoStack) window.redoStack.length = 0; else window.redoStack = [];
|
|
694
697
|
|
|
695
698
|
if (typeof window.clearAllSelections === 'function') {
|
|
696
699
|
window.clearAllSelections();
|