From 4f1dfae696d12848895eb462811ee47eee86a4a4 Mon Sep 17 00:00:00 2001 From: Ladd Date: Sat, 27 Dec 2025 12:01:50 -0600 Subject: [PATCH] fixed zoom to fit --- display.js | 5 +++-- tool/zoom.js | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/display.js b/display.js index 1908bb8..e8b6ee4 100644 --- a/display.js +++ b/display.js @@ -193,7 +193,8 @@ export class Display { ctx.fill(); // Draw arrow for the velocity - if (this.sim.getOption('show.velocity')) { + if (this.sim.getOption('display.velocity')) { + console.log('velocity vector'); const speed = Math.sqrt(vx ** 2 + vy ** 2); const endVx = x + VELOCITY_VECTOR_SCALE * vx / speed * Math.log(speed); const endVy = y + VELOCITY_VECTOR_SCALE * vy / speed * Math.log(speed); @@ -209,7 +210,7 @@ export class Display { } // Draw arrow for acceleration - if (this.sim.getOption('show.acceleration')) { + if (this.sim.getOption('display.acceleration')) { const accelerationMagnitude = Math.sqrt(acceleration.x ** 2 + acceleration.y ** 2); const endAx = x + ACCELERATION_VECTOR_SCALE * acceleration.x / accelerationMagnitude * Math.log(accelerationMagnitude); diff --git a/tool/zoom.js b/tool/zoom.js index 317e488..934a20f 100644 --- a/tool/zoom.js +++ b/tool/zoom.js @@ -49,7 +49,6 @@ export class Zoom extends Tool { const biggerRatio = Math.max(widthRatio, heightRatio); const base2factor = Math.log(1/biggerRatio) / Math.log(2); const factor = Math.floor(base2factor) - 1; - console.log({biggerRatio, base2factor, factor}); this.sim.scheduleZoom({x, y}, factor); } });