()
| 28 | } |
| 29 | |
| 30 | drawObject() { |
| 31 | // Draw the dash. |
| 32 | for (let i = 0; i < 10; i++) { |
| 33 | let y = 5 + i * 20; |
| 34 | |
| 35 | this._shape.fillRect(this._space, y, this._barWidth, this._barHeight, this.dashColor); |
| 36 | } |
| 37 | |
| 38 | // Draw bars. |
| 39 | if (this._currBar >= this._barMax) { |
| 40 | this._currBar = -100; |
| 41 | } else { |
| 42 | let bar = this._currBar / 100; |
| 43 | |
| 44 | let colors = []; |
| 45 | |
| 46 | if (this._isGradient) { |
| 47 | colors = Utility.generateGradientColor(COLOR.white, this.barColor, bar); |
| 48 | } else { |
| 49 | this._ctx.fillStyle = this.barColor; |
| 50 | } |
| 51 | |
| 52 | for (let i = 0; i < bar; i++) { |
| 53 | let y = this._viewHeight - (15 + i * 20); |
| 54 | |
| 55 | if (this._isGradient) { |
| 56 | this._ctx.fillStyle = '#' + colors[i]; |
| 57 | } |
| 58 | |
| 59 | this._ctx.beginPath(); |
| 60 | this._ctx.fillRect(this._space, y, this._barWidth, this._barHeight); |
| 61 | this._ctx.closePath(); |
| 62 | } |
| 63 | |
| 64 | this._currBar += this.speed; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | set value(value) { |
| 69 | this._value = value; |
nothing calls this directly
no test coverage detected