1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

fix: flip linear elements after redesign (#5538)

This commit is contained in:
Aakansha Doshi 2022-08-04 18:41:31 +05:30 committed by GitHub
parent 0a5da0269f
commit 3d9d398378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 16 deletions

@ -62,18 +62,6 @@ const OMIT_SIDES_FOR_LINE_BACKSLASH = {
w: true,
};
const OMIT_SIDES_FOR_LINEAR_ELEMENT = {
e: true,
s: true,
n: true,
w: true,
nw: true,
se: true,
ne: true,
sw: true,
rotation: true,
};
const generateTransformHandle = (
x: number,
y: number,
@ -241,9 +229,7 @@ export const getTransformHandles = (
}
let omitSides: { [T in TransformHandleType]?: boolean } = {};
if (isLinearElement(element)) {
omitSides = OMIT_SIDES_FOR_LINEAR_ELEMENT;
} else if (element.type === "freedraw") {
if (element.type === "freedraw" || isLinearElement(element)) {
if (element.points.length === 2) {
// only check the last point because starting point is always (0,0)
const [, p1] = element.points;

@ -447,7 +447,10 @@ export const _renderScene = (
renderConfig.zoom,
"mouse", // when we render we don't know which pointer type so use mouse
);
if (!appState.viewModeEnabled) {
if (
!appState.viewModeEnabled &&
!isLinearElement(locallySelectedElements[0])
) {
renderTransformHandles(
context,
renderConfig,