diff --git a/entry/src/main/js/default/common/component/LVBattery/LVBattery.js b/entry/src/main/js/default/common/component/LVBattery/LVBattery.js index 61a4eb762b2b55f2735793d55ccf09f40d2614f0..bd715347ffe2905f0ffafca5cac9d5ac99bdde73 100644 --- a/entry/src/main/js/default/common/component/LVBattery/LVBattery.js +++ b/entry/src/main/js/default/common/component/LVBattery/LVBattery.js @@ -102,27 +102,59 @@ export default { drawBody(ctx) { ctx.beginPath(); ctx.strokeStyle = this.controller.getViewColor() - ctx.arc(this.rectFBody.left + this.mBodyCorner, this.rectFBody.top + this.mBodyCorner, this.mBodyCorner, -Math.PI, -Math.PI / 2) + ctx.arc(this.rectFBody.left + this.mBodyCorner, + this.rectFBody.top + this.mBodyCorner, + this.mBodyCorner, + -Math.PI, -Math.PI / 2) ctx.lineTo(this.rectFBody.right - this.mBodyCorner, this.rectFBody.top) - ctx.arc(this.rectFBody.right - this.mBodyCorner, this.rectFBody.top + this.mBodyCorner, this.mBodyCorner, -Math.PI / 2, 0) + ctx.arc(this.rectFBody.right - this.mBodyCorner, + this.rectFBody.top + this.mBodyCorner, + this.mBodyCorner, + -Math.PI / 2, 0) ctx.lineTo(this.rectFBody.right, this.rectFBody.bottom - this.mBodyCorner) - ctx.arc(this.rectFBody.right - this.mBodyCorner, this.rectFBody.bottom - this.mBodyCorner, this.mBodyCorner, 0, Math.PI / 2) - ctx.lineTo(this.rectFBody.left + this.mBodyCorner, this.rectFBody.bottom) - ctx.arc(this.rectFBody.left + this.mBodyCorner, this.rectFBody.bottom - this.mBodyCorner, this.mBodyCorner, Math.PI / 2, Math.PI) + ctx.arc(this.rectFBody.right - this.mBodyCorner, + this.rectFBody.bottom - this.mBodyCorner, + this.mBodyCorner, + 0, + Math.PI / 2) + ctx.lineTo(this.rectFBody.left + this.mBodyCorner, + this.rectFBody.bottom) + ctx.arc(this.rectFBody.left + this.mBodyCorner, + this.rectFBody.bottom - this.mBodyCorner, + this.mBodyCorner, + Math.PI / 2, + Math.PI) ctx.lineTo(this.rectFBody.left, this.rectFBody.top + this.mBodyCorner) ctx.stroke(); }, drawValue(ctx) { - this.rectFBodyValue.top = this.rectFBodyValue.bottom - (this.rectFBodyValue.bottom - this.rectFBody.top - this.mBatterySpace) * this.controller.getAnimValue() + this.rectFBodyValue.top = this.rectFBodyValue.bottom - (this.rectFBodyValue.bottom - + this.rectFBody.top - this.mBatterySpace) * this.controller.getAnimValue() ctx.beginPath(); ctx.fillStyle = this.controller.getCellColor() - ctx.arc(this.rectFBodyValue.left + this.mBodyValueCorner, this.rectFBodyValue.top + this.mBodyValueCorner, this.mBodyValueCorner, -Math.PI, -Math.PI / 2) + ctx.arc(this.rectFBodyValue.left + this.mBodyValueCorner, + this.rectFBodyValue.top + this.mBodyValueCorner, + this.mBodyValueCorner, + -Math.PI, + -Math.PI / 2) ctx.lineTo(this.rectFBodyValue.right - this.mBodyValueCorner, this.rectFBodyValue.top) - ctx.arc(this.rectFBodyValue.right - this.mBodyValueCorner, this.rectFBodyValue.top + this.mBodyValueCorner, this.mBodyValueCorner, -Math.PI / 2, 0) + ctx.arc(this.rectFBodyValue.right - this.mBodyValueCorner, + this.rectFBodyValue.top + this.mBodyValueCorner, + this.mBodyValueCorner, + -Math.PI / 2, + 0) ctx.lineTo(this.rectFBodyValue.right, this.rectFBodyValue.bottom - this.mBodyValueCorner) - ctx.arc(this.rectFBodyValue.right - this.mBodyValueCorner, this.rectFBodyValue.bottom - this.mBodyValueCorner, this.mBodyValueCorner, 0, Math.PI / 2) + ctx.arc(this.rectFBodyValue.right - this.mBodyValueCorner, + this.rectFBodyValue.bottom - this.mBodyValueCorner, + this.mBodyValueCorner, + 0, + Math.PI / 2) ctx.lineTo(this.rectFBodyValue.left + this.mBodyValueCorner, this.rectFBodyValue.bottom) - ctx.arc(this.rectFBodyValue.left + this.mBodyValueCorner, this.rectFBodyValue.bottom - this.mBodyValueCorner, this.mBodyValueCorner, Math.PI / 2, Math.PI) + ctx.arc(this.rectFBodyValue.left + this.mBodyValueCorner, + this.rectFBodyValue.bottom - this.mBodyValueCorner, + this.mBodyValueCorner, + Math.PI / 2, + Math.PI) ctx.lineTo(this.rectFBodyValue.left, this.rectFBodyValue.top + this.mBodyValueCorner) ctx.fill(); },