Resize multiple elements (rectangles, diamonds and ellipses onl… (#1193)
* experiment resizing multiple elements * hack common component * calculate scale properly (still se only)fg * prioritize multi selection * take handle offset into calculation * fix master merge * refactor resizeElements out from App * wip: handlerRectanglesFromCoords * fix test with type assertion * properly show handles wip * revert previous one and do a tweak * remove unnecessary assignments * replace hack code with good one * refactor coords in arg * resize NW * resize from sw,ne * fix with setResizeHandle * do not show hint while resizing multiple elements * empty commit * fix format
This commit is contained in:
@ -162,12 +162,13 @@ function getSelectedElement(): ExcalidrawElement {
|
||||
return selectedElements[0];
|
||||
}
|
||||
|
||||
type HandlerRectanglesRet = keyof ReturnType<typeof handlerRectangles>;
|
||||
function getResizeHandles() {
|
||||
const rects = handlerRectangles(
|
||||
getSelectedElement(),
|
||||
h.state.zoom,
|
||||
pointerType,
|
||||
);
|
||||
const rects =
|
||||
handlerRectangles(getSelectedElement(), h.state.zoom, pointerType) as
|
||||
{
|
||||
[T in HandlerRectanglesRet]: [number, number, number, number];
|
||||
};
|
||||
|
||||
const rv: { [K in keyof typeof rects]: [number, number] } = {} as any;
|
||||
|
||||
|
Reference in New Issue
Block a user