mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Refactoring in pointer down event handler, step 2 (#1887)
* Refactor: introduce pointer down state to replace implicit closure state with an explicit object * Refactor: use pointer down state for resize handle * Refactor: use pointer down state for isResizing * Refactor: use pointer down state for resizing offset * Refactor: use pointer down state for hit element * Refactor: move selection handling out of pointer down event handler * Refactor: move text handling out of pointer down event handler * Refactor: move linear tools handling out of pointer down event handler * Refactor: move element creation out of pointer down handler
This commit is contained in:
parent
6cc6e13892
commit
5664de0459
2 changed files with 417 additions and 299 deletions
|
@ -241,3 +241,10 @@ const RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);
|
|||
export const isRTL = (text: string) => {
|
||||
return RE_RTL_CHECK.test(text);
|
||||
};
|
||||
|
||||
export function tupleToCoors(
|
||||
xyTuple: [number, number],
|
||||
): { x: number; y: number } {
|
||||
const [x, y] = xyTuple;
|
||||
return { x, y };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue