« get me outta code hell

Make HP bar render progress correctly - csb-game - Pixelly spin-off of the Command Synergy Battle system used in Final Fantasy XIII
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-08-12 10:13:23 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-12 10:13:23 -0300
commit0c1fe62b8b6486ce057edf41a25af5c5dc3b340b (patch)
treed550c3428dd7764749f33b6c1fffd4b119de9297
parent29313749c2b98157bb5848089adc7967719f010a (diff)
Make HP bar render progress correctly
-rw-r--r--index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.js b/index.js
index f2c7412..d1273cb 100644
--- a/index.js
+++ b/index.js
@@ -184,7 +184,7 @@ class HPBar {
     ctx.save()
 
     ctx.beginPath()
-    ctx.rect(0, 0, Math.round(this.canvas.width * this.visualProgress), this.canvas.height)
+    ctx.rect(1, 1, Math.ceil((this.canvas.width - 2) * this.visualProgress), this.canvas.height - 2)
     ctx.clip()
 
     ctx.fillStyle = '#5E5'