improve & granularize ExcalidrawElement types (#991)
* improve & granularize ExcalidrawElement types * fix incorrectly passing type * fix tests * fix more tests * fix unnecessary spreads & refactor * add comments
This commit is contained in:
@ -2,6 +2,7 @@ import { ExcalidrawElement, PointerType } from "./types";
|
||||
|
||||
import { handlerRectangles } from "./handlerRectangles";
|
||||
import { AppState } from "../types";
|
||||
import { isLinearElement } from "./typeChecks";
|
||||
|
||||
type HandlerRectanglesRet = keyof ReturnType<typeof handlerRectangles>;
|
||||
|
||||
@ -102,11 +103,7 @@ export function normalizeResizeHandle(
|
||||
element: ExcalidrawElement,
|
||||
resizeHandle: HandlerRectanglesRet,
|
||||
): HandlerRectanglesRet {
|
||||
if (
|
||||
(element.width >= 0 && element.height >= 0) ||
|
||||
element.type === "line" ||
|
||||
element.type === "arrow"
|
||||
) {
|
||||
if ((element.width >= 0 && element.height >= 0) || isLinearElement(element)) {
|
||||
return resizeHandle;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user