mirror of
https://github.com/excalidraw/excalidraw.git
synced 2024-11-10 11:35:52 +01:00
Refactoring in pointer down event handler, step 3 (#1888)
* Refactor: use pointer down state for alt duplication flag * Refactor: use pointer down state for drag state * Refactor: simplify over scrollbars check * Refactor: move pointer move handler out of pointer down handler * Refactor: move pointer up handler out of pointer down handler * Refactor: further simplify scrollbar check state in pointer down event * Refactor: pull out initial pointer down state creation
This commit is contained in:
parent
6e357c0291
commit
4ab4fce998
File diff suppressed because it is too large
Load Diff
@ -107,10 +107,11 @@ export const isOverScrollBars = (
|
||||
x: number,
|
||||
y: number,
|
||||
): {
|
||||
isOverHorizontalScrollBar: boolean;
|
||||
isOverVerticalScrollBar: boolean;
|
||||
isOverEither: boolean;
|
||||
isOverHorizontal: boolean;
|
||||
isOverVertical: boolean;
|
||||
} => {
|
||||
const [isOverHorizontalScrollBar, isOverVerticalScrollBar] = [
|
||||
const [isOverHorizontal, isOverVertical] = [
|
||||
scrollBars.horizontal,
|
||||
scrollBars.vertical,
|
||||
].map((scrollBar) => {
|
||||
@ -122,9 +123,6 @@ export const isOverScrollBars = (
|
||||
y <= scrollBar.y + scrollBar.height
|
||||
);
|
||||
});
|
||||
|
||||
return {
|
||||
isOverHorizontalScrollBar,
|
||||
isOverVerticalScrollBar,
|
||||
};
|
||||
const isOverEither = isOverHorizontal || isOverVertical;
|
||||
return { isOverEither, isOverHorizontal, isOverVertical };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user