mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-17 19:24:30 +01:00
refactor: rename draggingElement -> newElement (#8294)
* add newElement to appState * freedraw should not be an editing element * do not set editing element for freedraw and generic * remove ununsed `appState.draggingElement` * remove setting dragged for new linear element * decouple selection element from new element * fix hint for text bindables * update snapshot * fixes * fix frame regressions * add comments to types * document `editingElement` --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -151,10 +151,7 @@ export class LinearElementEditor {
|
||||
setState: React.Component<any, AppState>["setState"],
|
||||
elementsMap: NonDeletedSceneElementsMap,
|
||||
) {
|
||||
if (
|
||||
!appState.editingLinearElement ||
|
||||
appState.draggingElement?.type !== "selection"
|
||||
) {
|
||||
if (!appState.editingLinearElement || !appState.selectionElement) {
|
||||
return false;
|
||||
}
|
||||
const { editingLinearElement } = appState;
|
||||
@@ -166,7 +163,7 @@ export class LinearElementEditor {
|
||||
}
|
||||
|
||||
const [selectionX1, selectionY1, selectionX2, selectionY2] =
|
||||
getElementAbsoluteCoords(appState.draggingElement, elementsMap);
|
||||
getElementAbsoluteCoords(appState.selectionElement, elementsMap);
|
||||
|
||||
const pointsSceneCoords = LinearElementEditor.getPointsGlobalCoordinates(
|
||||
element,
|
||||
|
||||
Reference in New Issue
Block a user