tweak camera

This commit is contained in:
wassname
2018-12-03 18:04:10 +08:00
parent 1930b3596d
commit b65fa35d48
+1 -1
View File
@@ -34,7 +34,7 @@ class Renderer {
this.target_zoom = Math.min(this.config.max_zoom_factor, this.getZoom(minmax.min_x, minmax.max_x + 4, minmax.min_y + 2, minmax.max_y + 2.5));
this.zoom += 0.1 * (this.target_zoom - this.zoom);
this.translate_x += 0.1 * ((1.5 - minmax.min_x) - this.translate_x);
this.translate_y += 0.3 * ((minmax.max_y + 1.5) * this.zoom - this.translate_y);
this.translate_y += 0.3 * ((minmax.max_y + 1.3) * this.zoom - this.translate_y);
console.log(this.translate_y)
this.ctx.translate(this.translate_x * this.zoom, this.translate_y);
this.ctx.scale(this.zoom, -this.zoom);