-
Notifications
You must be signed in to change notification settings - Fork 334
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
Change borderCapStyle and borderJoinStyle defaults to be compatible with SKIA canvas #939
Conversation
Change LGTM, but it seems the CI fails |
I'll have a look. |
I think i need help with this. Edit: Actually, it looks like |
Actually, i'm getting the same build failure on the master branch. @LeeLenaleee can you check? |
I will look into it this weekend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mlohbihler @LeeLenaleee has written in the issue, we need to take care about options fallback.
As far as I remember, with this updates we are creating a breaking change because we are stopping the fallback of start and end config to arrowHeads configuration and not to the line options, as is today.
b42ea68
to
564277e
Compare
@mlohbihler LGTM. May be you can try the branch against SKIA canvas to check if it is working as expected. |
@mlohbihler the failed test has been fixed in #902. Therefore after merging of that and rebase this branch, we could re-run the failed job |
@stockiNail nice. Thanks for this. |
@mlohbihler if you will rebase and push again, we can go on. Take your time. Thanks a lot! |
Build checks are passing now, but i guess with the (net zero) playing around i did i lost my approval. Re-requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologize if I hadn't time before to have a look.
The changes are adding options not used by those annotations therefore I would prefer to change only the setBorderStyle
(reverting the current changes of PR) as following:
export function setBorderStyle(ctx, options) {
if (options && options.borderWidth) {
ctx.lineCap = options.borderCapStyle || 'butt';
ctx.setLineDash(options.borderDash);
ctx.lineDashOffset = options.borderDashOffset;
ctx.lineJoin = options.borderJoinStyle || 'miter';
ctx.lineWidth = options.borderWidth;
ctx.strokeStyle = options.borderColor;
return true;
}
}
Let me know what you think
That change seems to work for me. Note that there are other instances of these properties getting set. Not sure if they can be removed too. E.g. see https://github.com/mlohbihler/chartjs-plugin-annotation/blob/0bce23d13a8db9aa9c58a80e5fc2929b4dfbab71/src/types/box.js#L40 |
@mlohbihler the joinStyle and capstyle are used for setting on canvas only in the point that you have changed. |
Setting these defaults prevents errors when using annotations in the skia canvas context. See Issue for more details: #938