fix: flip linear elements after redesign (#5538)
This commit is contained in:
parent
0a5da0269f
commit
3d9d398378
@ -62,18 +62,6 @@ const OMIT_SIDES_FOR_LINE_BACKSLASH = {
|
|||||||
w: true,
|
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 = (
|
const generateTransformHandle = (
|
||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
@ -241,9 +229,7 @@ export const getTransformHandles = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
let omitSides: { [T in TransformHandleType]?: boolean } = {};
|
let omitSides: { [T in TransformHandleType]?: boolean } = {};
|
||||||
if (isLinearElement(element)) {
|
if (element.type === "freedraw" || isLinearElement(element)) {
|
||||||
omitSides = OMIT_SIDES_FOR_LINEAR_ELEMENT;
|
|
||||||
} else if (element.type === "freedraw") {
|
|
||||||
if (element.points.length === 2) {
|
if (element.points.length === 2) {
|
||||||
// only check the last point because starting point is always (0,0)
|
// only check the last point because starting point is always (0,0)
|
||||||
const [, p1] = element.points;
|
const [, p1] = element.points;
|
||||||
|
@ -447,7 +447,10 @@ export const _renderScene = (
|
|||||||
renderConfig.zoom,
|
renderConfig.zoom,
|
||||||
"mouse", // when we render we don't know which pointer type so use mouse
|
"mouse", // when we render we don't know which pointer type so use mouse
|
||||||
);
|
);
|
||||||
if (!appState.viewModeEnabled) {
|
if (
|
||||||
|
!appState.viewModeEnabled &&
|
||||||
|
!isLinearElement(locallySelectedElements[0])
|
||||||
|
) {
|
||||||
renderTransformHandles(
|
renderTransformHandles(
|
||||||
context,
|
context,
|
||||||
renderConfig,
|
renderConfig,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user