From 6be55ba52ef79907c0ade21e77a28ddc4f82bcc9 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 9 Aug 2018 19:25:49 -0300 Subject: Fix ATB gauge item widths --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 0e52b67..662edbe 100644 --- a/index.js +++ b/index.js @@ -46,8 +46,8 @@ class ATBBar { { let i = 0 for (const action of this.queuedActions) { - const rectX = Math.floor(segmentWidth * i) + 2 - const rectW = Math.floor(segmentWidth * (i + action.size)) - rectX - 2 + const rectX = Math.round(segmentWidth * i) + 2 + const rectW = Math.round(segmentWidth * (i + action.size)) - rectX - 2 - (i + action.size === this.segmentCount ? 1 : 0) // Ternary so it doesn't touch the right-edge of the entire ATB gauge box const textX = Math.round(rectX + rectW / 2) const rectH = this.canvas.height - 5 const text = action.label -- cgit 1.3.0-6-gf8a5