Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas: call ctx.setLineDash in _fillStroke #5454

Merged
merged 3 commits into from
Apr 20, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Canvas: call ctx.setLineDash in _fillStroke
This make dashArray working properly for cirles.

fix #5182
  • Loading branch information
TeXitoi committed Apr 12, 2017
commit 1e42c4648a59bf3dd17b0462190146bf76fc4a1d
7 changes: 3 additions & 4 deletions src/layer/vector/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ export var Canvas = Renderer.extend({

ctx.beginPath();

if (ctx.setLineDash) {
ctx.setLineDash(layer.options && layer.options._dashArray || []);
}

for (i = 0; i < len; i++) {
for (j = 0, len2 = parts[i].length; j < len2; j++) {
p = parts[i][j];
Expand Down Expand Up @@ -326,6 +322,9 @@ export var Canvas = Renderer.extend({
}

if (options.stroke && options.weight !== 0) {
if (ctx.setLineDash) {
ctx.setLineDash(layer.options && layer.options._dashArray || []);
}
ctx.globalAlpha = options.opacity;
ctx.lineWidth = options.weight;
ctx.strokeStyle = options.color;
Expand Down