Fix zoom to not jump anymore (#272)

* Remove scroll handling, honor zoom on drag + ctrl

* Add back ability to zoom with mouse wheel, but properly

* Add TODO for 'any' removal

* Update kittycad lib to remove 'any'
This commit is contained in:
Frank Noirot
2023-08-21 10:52:41 -04:00
committed by GitHub
parent 43b1272538
commit 25392824cb
4 changed files with 14 additions and 23 deletions

View File

@ -380,8 +380,11 @@ export function App() {
clientX,
clientY,
ctrlKey,
shiftKey,
currentTarget,
nativeEvent,
}) => {
nativeEvent.preventDefault()
if (isMouseDownInStream) {
setDidDragInStream(true)
}
@ -393,7 +396,7 @@ export function App() {
...streamDimensions,
})
const interaction = ctrlKey ? 'pan' : 'rotate'
const interaction = ctrlKey ? 'zoom' : shiftKey ? 'pan' : 'rotate'
const newCmdId = uuidv4()
setCmdId(newCmdId)
@ -432,7 +435,7 @@ export function App() {
return (
<div
className="h-screen overflow-hidden relative flex flex-col"
className="h-screen overflow-hidden relative flex flex-col cursor-pointer select-none"
onMouseMove={handleMouseMove}
ref={streamRef}
>