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:
@ -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 };
|
||||
}
|
||||
|
Reference in New Issue
Block a user