fix: scrollbar rendering and improve dragging (#9417)

* fix: scrollbar rendering and improve dragging

* tweak offsets
This commit is contained in:
David Luzar 2025-04-20 12:28:41 +02:00 committed by GitHub
parent 5fc13e4309
commit 8fb2f70414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 60 additions and 23 deletions

View file

@ -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;