mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Refactoring in pointer down event handler (#1880)
* Refactor: Move context menu touch device handling * Refactor: Move more stuff out of pointer down * Refactor: Move last coords into an object * Refactor: Move scrollbar handling out of pointer down * Refactor: simplify resizing in pointer down * Refactor: further simplify resizing in pointer down * Refactor: clarify clearing selection code * Refactor: move out clearing selection from pointer down * Refactor: further simplify deselection in pointer down
This commit is contained in:
parent
d5e7d08586
commit
5d7020cce6
3 changed files with 278 additions and 226 deletions
|
@ -106,13 +106,16 @@ export const isOverScrollBars = (
|
|||
scrollBars: ScrollBars,
|
||||
x: number,
|
||||
y: number,
|
||||
) => {
|
||||
): {
|
||||
isOverHorizontalScrollBar: boolean;
|
||||
isOverVerticalScrollBar: boolean;
|
||||
} => {
|
||||
const [isOverHorizontalScrollBar, isOverVerticalScrollBar] = [
|
||||
scrollBars.horizontal,
|
||||
scrollBars.vertical,
|
||||
].map((scrollBar) => {
|
||||
return (
|
||||
scrollBar &&
|
||||
scrollBar != null &&
|
||||
scrollBar.x <= x &&
|
||||
x <= scrollBar.x + scrollBar.width &&
|
||||
scrollBar.y <= y &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue