mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-03 10:22:13 +00:00
fix copied & cut stores
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { fileStateCollection } from '$lib/logic/file-state';
|
||||
import { fileActionManager } from '$lib/logic/file-action-manager';
|
||||
import { selection } from '$lib/logic/selection';
|
||||
import { copied, cut, selection } from '$lib/logic/selection';
|
||||
import { currentTool, Tool } from '$lib/components/toolbar/tools';
|
||||
import type { SplitType } from '$lib/components/toolbar/tools/scissors/scissors';
|
||||
import {
|
||||
@@ -927,7 +927,7 @@ export const fileActions = {
|
||||
};
|
||||
|
||||
export function pasteSelection() {
|
||||
let fromItems = selection.copied;
|
||||
let fromItems = get(copied);
|
||||
if (fromItems === undefined || fromItems.length === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ export function pasteSelection() {
|
||||
}
|
||||
|
||||
if (fromItems.length === toItems.length) {
|
||||
moveItems(fromParent, toParent, fromItems, toItems, selection.cut);
|
||||
moveItems(fromParent, toParent, fromItems, toItems, get(cut));
|
||||
selection.resetCopied();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,6 +212,8 @@ export class Selection {
|
||||
}
|
||||
|
||||
export const selection = new Selection();
|
||||
export const copied = selection.copied;
|
||||
export const cut = selection.cut;
|
||||
|
||||
export function applyToOrderedItemsFromFile(
|
||||
selectedItems: ListItem[],
|
||||
|
||||
Reference in New Issue
Block a user