|
|
|
|
@ -641,7 +641,11 @@ function exp_decay(a, b, decay, dt) {
@@ -641,7 +641,11 @@ function exp_decay(a, b, decay, dt) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function update_canvas_zoom(state, current, target, dt) { |
|
|
|
|
const decay = 16; |
|
|
|
|
let decay = config.animation_decay; |
|
|
|
|
|
|
|
|
|
if (state.zoomdown) { |
|
|
|
|
decay *= config.vertical_zoom_speed_multiplier; // to make it feel more responsive at fast speed
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Math.abs(1.0 - current / target) > 0.01) { |
|
|
|
|
state.canvas.zoom = exp_decay(state.canvas.zoom, target, decay, dt / 1000.0); |
|
|
|
|
|