mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Refactor ExcalidrawElement (#874)
* Get rid of isSelected, canvas, canvasZoom, canvasOffsetX and canvasOffsetY on ExcalidrawElement. * Fix most unit tests. Fix cmd a. Fix alt drag * Focus on paste * shift select should include previously selected items * Fix last test * Move this.shape out of ExcalidrawElement and into a WeakMap
This commit is contained in:
parent
8ecb4201db
commit
ccbbdb75a6
39 changed files with 416 additions and 306 deletions
|
@ -20,7 +20,10 @@ export const actionSendBackward = register({
|
|||
name: "sendBackward",
|
||||
perform: (elements, appState) => {
|
||||
return {
|
||||
elements: moveOneLeft([...elements], getSelectedIndices(elements)),
|
||||
elements: moveOneLeft(
|
||||
[...elements],
|
||||
getSelectedIndices(elements, appState),
|
||||
),
|
||||
appState,
|
||||
};
|
||||
},
|
||||
|
@ -44,7 +47,10 @@ export const actionBringForward = register({
|
|||
name: "bringForward",
|
||||
perform: (elements, appState) => {
|
||||
return {
|
||||
elements: moveOneRight([...elements], getSelectedIndices(elements)),
|
||||
elements: moveOneRight(
|
||||
[...elements],
|
||||
getSelectedIndices(elements, appState),
|
||||
),
|
||||
appState,
|
||||
};
|
||||
},
|
||||
|
@ -68,7 +74,10 @@ export const actionSendToBack = register({
|
|||
name: "sendToBack",
|
||||
perform: (elements, appState) => {
|
||||
return {
|
||||
elements: moveAllLeft([...elements], getSelectedIndices(elements)),
|
||||
elements: moveAllLeft(
|
||||
[...elements],
|
||||
getSelectedIndices(elements, appState),
|
||||
),
|
||||
appState,
|
||||
};
|
||||
},
|
||||
|
@ -91,7 +100,10 @@ export const actionBringToFront = register({
|
|||
name: "bringToFront",
|
||||
perform: (elements, appState) => {
|
||||
return {
|
||||
elements: moveAllRight([...elements], getSelectedIndices(elements)),
|
||||
elements: moveAllRight(
|
||||
[...elements],
|
||||
getSelectedIndices(elements, appState),
|
||||
),
|
||||
appState,
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue