-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
test(): add globalCompositeOperation
tests
#8271
Conversation
commit e121c47 Author: ShaMan123 <shacharnen@gmail.com> Date: Sun Sep 11 12:12:40 2022 +0300 checkout commit 5ce9d1c Author: ShaMan123 <shacharnen@gmail.com> Date: Sun Sep 11 12:09:08 2022 +0300 fix(): golden generation from browser await all async tasks commit 1672b59 Author: ShaMan123 <shacharnen@gmail.com> Date: Sun Sep 11 11:45:38 2022 +0300 fix(): filename is truncated by busboy
This reverts commit 6d39669.
canvas.backgroundImage = createExisting(); | ||
canvas.add(createNew(operation), createPreview(operation)); |
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.
this will break as soon as we fix globalCompositeOperation to be group scoped.
We should make the tests already aware of group, so adding all those elements, background, previews and circles in the same group as siblings.
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.
please explain
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.
global composite operation reacts differently if you are using caching or not.
When a group is cached a circle inside a group will stop its global composite operation effect on the group itself and won't reach the canvas, because the group cache is rendered with the group own value of global composite operation.
This isn't explained in fabricJS is just a side effect of caching.
global composite operation should introduce a rule like we have for shadow.
If a global composite operation is detected, caching is forced on, and the effect of global composite operation is from an object to its container.
This will make things predictable for the developer that uses global composite operation.
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.
so the tests are aligned to your comment:
If a global composite operation is detected, caching is forced on, and the effect of global composite operation is from an object to its container.
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.
ok then, at worst some bit will change and we will verify why and if should chnage
node-canvas has broken copy operation. I remember i noticed it and wrote tests for it Other return sligthly different results: |
}; | ||
|
||
function createExisting(center = new fabric.Point(size.width, size.height).scalarDivide(2)) { | ||
return new fabric.Image(colorSphere(radius * 2), { |
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.
i meant a real png :D this is the same as before, just called once.
Can we make this a fixture?
Ooops sorry
בתאריך יום ב׳, 12 בספט׳ 2022, 14:34, מאת Andrea Bogazzi <
***@***.***>:
… Merged #8271 <#8271> into
master.
—
Reply to this email directly, view it on GitHub
<#8271 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIGAW4J7JZQBVYW6CHMHI43V54ILNANCNFSM6AAAAAAQJWIMAY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Shall I make a fixture then? |
Add tests based on https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation#operations
canvas-node
fails to render some of the operations on my machine... strange