feat: Add option to flip single element on the context menu (#2520)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
@ -6,6 +6,7 @@ import {
|
||||
import { CODES } from "../../keys";
|
||||
import { ToolName } from "../queries/toolQueries";
|
||||
import { fireEvent, GlobalTestState } from "../test-utils";
|
||||
import { mutateElement } from "../../element/mutateElement";
|
||||
import { API } from "./api";
|
||||
|
||||
const { h } = window;
|
||||
@ -202,6 +203,7 @@ export class UI {
|
||||
size = 10,
|
||||
width = size,
|
||||
height = width,
|
||||
angle = 0,
|
||||
}: {
|
||||
position?: number;
|
||||
x?: number;
|
||||
@ -209,6 +211,7 @@ export class UI {
|
||||
size?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
angle?: number;
|
||||
} = {},
|
||||
): (T extends "arrow" | "line" | "draw"
|
||||
? ExcalidrawLinearElement
|
||||
@ -231,6 +234,10 @@ export class UI {
|
||||
|
||||
const origElement = h.elements[h.elements.length - 1] as any;
|
||||
|
||||
if (angle !== 0) {
|
||||
mutateElement(origElement, { angle });
|
||||
}
|
||||
|
||||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
|
Reference in New Issue
Block a user