« get me outta code hell

Fix ATB gauge item widths - csb-game - Pixelly spin-off of the Command Synergy Battle system used in Final Fantasy XIII
summary refs log tree commit diff
path: root/index.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-08-09 19:25:49 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-09 19:25:49 -0300
commit6be55ba52ef79907c0ade21e77a28ddc4f82bcc9 (patch)
treefe9d5ddc3e679eca5e6c1e3a7e651bda29d6260a /index.js
parent9de7cad6799b551be1bc232cc6e9cff54a18eac6 (diff)
Fix ATB gauge item widths
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
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