mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add action to wrap selected items in a frame (#9005)
* feat: add action to wrap selected items in a frame * fix type * select frame on wrap & refactor --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
c92f3bebf5
commit
00b5b0a0ca
9 changed files with 111 additions and 4 deletions
|
@ -378,6 +378,7 @@ import { actionPaste } from "../actions/actionClipboard";
|
|||
import {
|
||||
actionRemoveAllElementsFromFrame,
|
||||
actionSelectAllElementsInFrame,
|
||||
actionWrapSelectionInFrame,
|
||||
} from "../actions/actionFrame";
|
||||
import { actionToggleHandTool, zoomToFit } from "../actions/actionCanvas";
|
||||
import { jotaiStore } from "../jotai";
|
||||
|
@ -10664,8 +10665,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||
actionCut,
|
||||
actionCopy,
|
||||
actionPaste,
|
||||
CONTEXT_MENU_SEPARATOR,
|
||||
actionSelectAllElementsInFrame,
|
||||
actionRemoveAllElementsFromFrame,
|
||||
actionWrapSelectionInFrame,
|
||||
CONTEXT_MENU_SEPARATOR,
|
||||
actionToggleCropEditor,
|
||||
CONTEXT_MENU_SEPARATOR,
|
||||
|
|
|
@ -263,6 +263,7 @@ function CommandPaletteInner({
|
|||
actionManager.actions.cut,
|
||||
actionManager.actions.copy,
|
||||
actionManager.actions.deleteSelectedElements,
|
||||
actionManager.actions.wrapSelectionInFrame,
|
||||
actionManager.actions.copyStyles,
|
||||
actionManager.actions.pasteStyles,
|
||||
actionManager.actions.bringToFront,
|
||||
|
|
|
@ -237,6 +237,7 @@ const MultiPosition = ({
|
|||
const [x1, y1] = getCommonBounds(elementsInUnit);
|
||||
return Math.round((property === "x" ? x1 : y1) * 100) / 100;
|
||||
}
|
||||
|
||||
const [el] = elementsInUnit;
|
||||
const [cx, cy] = [el.x + el.width / 2, el.y + el.height / 2];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue