Fix edge scrolling at odd browser zoom levels (#3973)
If you zoom in at 110% or more, edge scrolling was not working on the bottom and right edges. That's because we were setting insets using exact comparison when the document.body.scrollWidth/Height values were slightly off integers. ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [x] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [x] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Add a brief release note for your PR here.
This commit is contained in:
parent
57d0618ab7
commit
e48f4bb798
1 changed files with 2 additions and 2 deletions
|
@ -3044,9 +3044,9 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|||
// top
|
||||
screenBounds.minY !== 0,
|
||||
// right
|
||||
document.body.scrollWidth !== screenBounds.maxX,
|
||||
!approximately(document.body.scrollWidth, screenBounds.maxX, 1),
|
||||
// bottom
|
||||
document.body.scrollHeight !== screenBounds.maxY,
|
||||
!approximately(document.body.scrollHeight, screenBounds.maxY, 1),
|
||||
// left
|
||||
screenBounds.minX !== 0,
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue