make scrollwheel work better in chrome

This commit is contained in:
koehr 2022-01-05 01:09:44 +01:00
parent 2f75d5bce2
commit f44b65eb8c
2 changed files with 4 additions and 2 deletions

View file

@ -70,7 +70,6 @@ function selectObject (object) {
}
function updateSelectedObject (payload) {
console.log('updating selected object', payload)
for (const key in payload) {
selectedObject.value[key] = payload[key]
}

View file

@ -108,7 +108,10 @@ function resizeObject (event) {
event.preventDefault()
let radius = props.selectedObject.radius
radius = Math.round(radius + event.deltaY * -0.01)
radius = radius + event.deltaY * -0.01
if (event.deltaY > 0) radius = Math.floor(radius)
else radius = Math.ceil(radius)
if (radius < MIN_SIZE_PLANET) radius = MIN_SIZE_PLANET
if (radius > MAX_SIZE_PLANET) radius = MAX_SIZE_PLANET