dont rerender if not able to zoom in/out

This commit is contained in:
Zutatensuppe 2021-04-15 10:06:20 +02:00
parent 38bef17010
commit be2a651ae6

View file

@ -608,15 +608,17 @@ async function main() {
_last_mouse_down = null
} else if (type === Protocol.INPUT_EV_ZOOM_IN) {
const pos = { x: evt[1], y: evt[2] }
viewport.zoomIn(viewport.worldToViewport(pos))
if (viewport.zoomIn(viewport.worldToViewport(pos))) {
RERENDER = true
}
} else if (type === Protocol.INPUT_EV_ZOOM_OUT) {
const pos = { x: evt[1], y: evt[2] }
viewport.zoomOut(viewport.worldToViewport(pos))
if (viewport.zoomOut(viewport.worldToViewport(pos))) {
RERENDER = true
}
}
}
}
finished = Game.getFinishTs(gameId)
if (justFinished()) {