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 the spell error which makes the gradientTransform doesn't work #7059

Merged
merged 6 commits into from
Jun 6, 2021

Conversation

corleone113
Copy link
Contributor

No description provided.

@corleone113
Copy link
Contributor Author

Just fix the spell error in the source files, which may cause the gradientTransform doesn't work at some condition.

@asturur
Copy link
Member

asturur commented May 14, 2021

hi @corleone113. Thanks for the fix.
We are fixing something, but the tests are all passing.
That means that this particular code change isn't covered by any test. This also means that if we break it again, we do not have alarms for it.

Could you please try to add a test?
We need a visual test that give a gradient with gradientTrasnform will render properly.
Both for text and any other object.

If you need help to write it i can help, but you can find here examples:
https://github.com/fabricjs/fabric.js/blob/5c4c9573e382066cc701b49a5099fb454ea9e788/test/visual/generic_rendering.js

@corleone113
Copy link
Contributor Author

Hi @asturur.
I've add a visual test. Because the fix just change few codes, so the test cases is few. If that didn't meet your standards, you can notify me as soon.

@asturur
Copy link
Member

asturur commented May 16, 2021

@corleone113 the test can be added in the existing file with other tests. Otherwise i have to add this new file to the website and is extra work. The generic render file is good enough ( the one i linked ).

The other important thing is that your test is sort of invalid.
You need to create a standard fabricJS gradient, while what you created is sort of mocked object for it.

look how this test is defined:

function backgroundWithGradientNoVpt(canvas, callback) {

function gradientStroke(canvas, callback) {
var line = new fabric.Line([10, 10, 200, 200], {
stroke: {
toLive(ctx) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this stroke: { toLive: .... } the correct form, as you can see in other tests is:

var line = new fabric.Line([10, 10, 200, 200], {
  stroke: new fabric.Gradient({ ... options })
})

@corleone113
Copy link
Contributor Author

corleone113 commented May 17, 2021 via email

@corleone113
Copy link
Contributor Author

I've fixed the invalid test codes, please review again.

@asturur
Copy link
Member

asturur commented May 17, 2021

Code looks good, i need to validate the test manually the text test seems too small to fail with a 9% rate.
i'll do it today and in case merge

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Jun 2, 2021
@asturur asturur added bug and removed stale Issue marked as stale by the stale bot labels Jun 6, 2021
@asturur asturur merged commit 29867e5 into fabricjs:master Jun 6, 2021
@asturur asturur mentioned this pull request Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants