diff options
author | Florrie <towerofnix@gmail.com> | 2018-08-09 19:25:49 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-08-09 19:25:49 -0300 |
commit | 6be55ba52ef79907c0ade21e77a28ddc4f82bcc9 (patch) | |
tree | fe9d5ddc3e679eca5e6c1e3a7e651bda29d6260a | |
parent | 9de7cad6799b551be1bc232cc6e9cff54a18eac6 (diff) |
Fix ATB gauge item widths
-rw-r--r-- | index.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 |