mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
select a single linear el
This commit is contained in:
parent
b0e38ec18c
commit
2a72e041ed
1 changed files with 22 additions and 2 deletions
|
@ -2,8 +2,13 @@ import { GlobalPoint, pointFrom } from "../../math";
|
||||||
import { AnimatedTrail } from "../animated-trail";
|
import { AnimatedTrail } from "../animated-trail";
|
||||||
import { AnimationFrameHandler } from "../animation-frame-handler";
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
||||||
import App from "../components/App";
|
import App from "../components/App";
|
||||||
import { isFrameLikeElement } from "../element/typeChecks";
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
||||||
import { ExcalidrawElement } from "../element/types";
|
import { isFrameLikeElement, isLinearElement } from "../element/typeChecks";
|
||||||
|
import {
|
||||||
|
ExcalidrawElement,
|
||||||
|
ExcalidrawLinearElement,
|
||||||
|
NonDeleted,
|
||||||
|
} from "../element/types";
|
||||||
import { getFrameChildren } from "../frame";
|
import { getFrameChildren } from "../frame";
|
||||||
import { selectGroupsForSelectedElements } from "../groups";
|
import { selectGroupsForSelectedElements } from "../groups";
|
||||||
import { easeOut } from "../utils";
|
import { easeOut } from "../utils";
|
||||||
|
@ -77,9 +82,24 @@ export class LassoTrail extends AnimatedTrail {
|
||||||
this.app,
|
this.app,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const selectedIds = [...Object.keys(nextSelection.selectedElementIds)];
|
||||||
|
const selectedGroupIds = [
|
||||||
|
...Object.keys(nextSelection.selectedGroupIds),
|
||||||
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
selectedElementIds: nextSelection.selectedElementIds,
|
selectedElementIds: nextSelection.selectedElementIds,
|
||||||
selectedGroupIds: nextSelection.selectedGroupIds,
|
selectedGroupIds: nextSelection.selectedGroupIds,
|
||||||
|
selectedLinearElement:
|
||||||
|
selectedIds.length === 1 &&
|
||||||
|
!selectedGroupIds.length &&
|
||||||
|
isLinearElement(this.app.scene.getNonDeletedElement(selectedIds[0]))
|
||||||
|
? new LinearElementEditor(
|
||||||
|
this.app.scene.getNonDeletedElement(
|
||||||
|
selectedIds[0],
|
||||||
|
) as NonDeleted<ExcalidrawLinearElement>,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue