mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: scrollbar rendering and improve dragging (#9417)
* fix: scrollbar rendering and improve dragging * tweak offsets
This commit is contained in:
parent
5fc13e4309
commit
8fb2f70414
3 changed files with 60 additions and 23 deletions
|
@ -8787,7 +8787,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||
const x = event.clientX;
|
||||
const dx = x - pointerDownState.lastCoords.x;
|
||||
this.translateCanvas({
|
||||
scrollX: this.state.scrollX - dx / this.state.zoom.value,
|
||||
scrollX:
|
||||
this.state.scrollX -
|
||||
(dx * (currentScrollBars.horizontal?.deltaMultiplier || 1)) /
|
||||
this.state.zoom.value,
|
||||
});
|
||||
pointerDownState.lastCoords.x = x;
|
||||
return true;
|
||||
|
@ -8797,7 +8800,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||
const y = event.clientY;
|
||||
const dy = y - pointerDownState.lastCoords.y;
|
||||
this.translateCanvas({
|
||||
scrollY: this.state.scrollY - dy / this.state.zoom.value,
|
||||
scrollY:
|
||||
this.state.scrollY -
|
||||
(dy * (currentScrollBars.vertical?.deltaMultiplier || 1)) /
|
||||
this.state.zoom.value,
|
||||
});
|
||||
pointerDownState.lastCoords.y = y;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue