diff options
Diffstat (limited to '')
-rw-r--r-- | js/RrdGfxCanvas.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/js/RrdGfxCanvas.js b/js/RrdGfxCanvas.js index 78b8adf..110c032 100644 --- a/js/RrdGfxCanvas.js +++ b/js/RrdGfxCanvas.js | |||
@@ -95,8 +95,21 @@ RrdGfxCanvas.prototype.dashed_line = function (X0, Y0, X1, Y1, width, color, das | |||
95 | this.ctx.save(); | 95 | this.ctx.save(); |
96 | this.ctx.lineWidth = width; | 96 | this.ctx.lineWidth = width; |
97 | this.ctx.strokeStyle = color; | 97 | this.ctx.strokeStyle = color; |
98 | 98 | this.ctx.setLineDash([ dash_on, dash_off ]); | |
99 | this.ctx.lineDashOffset = dash_on; | ||
99 | this.ctx.beginPath(); | 100 | this.ctx.beginPath(); |
101 | |||
102 | if (Y0 === Y1) { | ||
103 | Y0 += 0.5; | ||
104 | Y1 += 0.5; | ||
105 | } else if (X0 === X1) { | ||
106 | X0 += 0.5; | ||
107 | X1 += 0.5; | ||
108 | } | ||
109 | |||
110 | this.ctx.moveTo(X0, Y0); | ||
111 | this.ctx.lineTo(X1, Y1); | ||
112 | /* | ||
100 | if (Y0 === Y1) { | 113 | if (Y0 === Y1) { |
101 | Y0 += 0.5; | 114 | Y0 += 0.5; |
102 | Y1 += 0.5; | 115 | Y1 += 0.5; |
@@ -142,6 +155,7 @@ RrdGfxCanvas.prototype.dashed_line = function (X0, Y0, X1, Y1, width, color, das | |||
142 | this.ctx.moveTo(X0, Y0); | 155 | this.ctx.moveTo(X0, Y0); |
143 | this.ctx.lineTo(X1, Y1); | 156 | this.ctx.lineTo(X1, Y1); |
144 | } | 157 | } |
158 | */ | ||
145 | this.ctx.stroke(); | 159 | this.ctx.stroke(); |
146 | this.ctx.restore(); | 160 | this.ctx.restore(); |
147 | }; | 161 | }; |