mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
Merge pull request #3242 from Pikamander2/new_branch
Fix zero border width not working (issue #3241)
This commit is contained in:
commit
2268bef321
@ -324,6 +324,7 @@ module.exports = function(Chart) {
|
|||||||
ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);
|
ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);
|
||||||
ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth);
|
ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth);
|
||||||
ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);
|
ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);
|
||||||
|
var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);
|
||||||
|
|
||||||
if (ctx.setLineDash) {
|
if (ctx.setLineDash) {
|
||||||
// IE 9 and 10 do not support line dash
|
// IE 9 and 10 do not support line dash
|
||||||
@ -343,7 +344,10 @@ module.exports = function(Chart) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Draw box as legend symbol
|
// Draw box as legend symbol
|
||||||
ctx.strokeRect(x, y, boxWidth, fontSize);
|
if (!isLineWidthZero)
|
||||||
|
{
|
||||||
|
ctx.strokeRect(x, y, boxWidth, fontSize);
|
||||||
|
}
|
||||||
ctx.fillRect(x, y, boxWidth, fontSize);
|
ctx.fillRect(x, y, boxWidth, fontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user