From 5773a9b8b46191fd1d0e726a70f6d4c9929df808 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 5 Sep 2021 12:11:47 -0400 Subject: [PATCH] Fix the scale lines looking uneven Some lines were being drawn at non-integral positions. The x and y coordinates are now floored before use. --- macrovision.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/macrovision.js b/macrovision.js index 49742d92..fd4e5dcf 100644 --- a/macrovision.js +++ b/macrovision.js @@ -772,6 +772,9 @@ function drawVerticalScale(ifDirty = false) { const oldStroke = ctx.strokeStyle; const oldFill = ctx.fillStyle; + x = Math.round(x); + y = Math.round(y); + ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + 20, y); @@ -969,6 +972,9 @@ function drawHorizontalScale(ifDirty = false) { function drawTick(/** @type {CanvasRenderingContext2D} */ ctx, x, y, label) { ctx.save() + x = Math.round(x); + y = Math.round(y); + ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x, y + 20);