make scrollwheel work better in chrome
This commit is contained in:
parent
2f75d5bce2
commit
f44b65eb8c
2 changed files with 4 additions and 2 deletions
|
@ -70,7 +70,6 @@ function selectObject (object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelectedObject (payload) {
|
function updateSelectedObject (payload) {
|
||||||
console.log('updating selected object', payload)
|
|
||||||
for (const key in payload) {
|
for (const key in payload) {
|
||||||
selectedObject.value[key] = payload[key]
|
selectedObject.value[key] = payload[key]
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,10 @@ function resizeObject (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
||||||
let radius = props.selectedObject.radius
|
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 < MIN_SIZE_PLANET) radius = MIN_SIZE_PLANET
|
||||||
if (radius > MAX_SIZE_PLANET) radius = MAX_SIZE_PLANET
|
if (radius > MAX_SIZE_PLANET) radius = MAX_SIZE_PLANET
|
||||||
|
|
Loading…
Add table
Reference in a new issue