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

fix: Using an odd number of elements in strokeDashArray will contaminate the original data #10293

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

zhe-he
Copy link
Contributor

@zhe-he zhe-he commented Nov 21, 2024

closes #10292

I found that the native Canvas API setLineDash supports odd-numbered arrays, and it automatically converts them into an even-numbered array. Can we remove our processing logic and directly pass an odd-numbered array without any additional handling?
The current modification follows the previous logic without changing the source array.

Copy link

codesandbox bot commented Nov 21, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@asturur
Copy link
Member

asturur commented Nov 21, 2024

I would try to remove the logic and see if node canvas is happy with it. If it isn't we need to keep the logic

@asturur
Copy link
Member

asturur commented Nov 26, 2024

node canvas seems ok with removing the full logic

@asturur asturur merged commit 992e003 into fabricjs:master Nov 26, 2024
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: The _setLineDash method has additional side effects, altering the value of strokeDashArray
2 participants