dont rerender if not able to zoom in/out
This commit is contained in:
parent
38bef17010
commit
be2a651ae6
1 changed files with 6 additions and 4 deletions
10
game/game.js
10
game/game.js
|
|
@ -608,12 +608,14 @@ async function main() {
|
||||||
_last_mouse_down = null
|
_last_mouse_down = null
|
||||||
} else if (type === Protocol.INPUT_EV_ZOOM_IN) {
|
} else if (type === Protocol.INPUT_EV_ZOOM_IN) {
|
||||||
const pos = { x: evt[1], y: evt[2] }
|
const pos = { x: evt[1], y: evt[2] }
|
||||||
viewport.zoomIn(viewport.worldToViewport(pos))
|
if (viewport.zoomIn(viewport.worldToViewport(pos))) {
|
||||||
RERENDER = true
|
RERENDER = true
|
||||||
|
}
|
||||||
} else if (type === Protocol.INPUT_EV_ZOOM_OUT) {
|
} else if (type === Protocol.INPUT_EV_ZOOM_OUT) {
|
||||||
const pos = { x: evt[1], y: evt[2] }
|
const pos = { x: evt[1], y: evt[2] }
|
||||||
viewport.zoomOut(viewport.worldToViewport(pos))
|
if (viewport.zoomOut(viewport.worldToViewport(pos))) {
|
||||||
RERENDER = true
|
RERENDER = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue