-
-
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
Shadow causes drop in perf #8076
Comments
This is a known issue with caching. |
The correct answer is yes. At that point sligly change the object render method to draw the shadow when is creating the cache ( i can help with that ),and not when is drawing the cache on top of the canvas. You should go back to 60fps |
as an alternative: const mkObject = (props) => {
const path = new fabric.Path(createPath(150, 150), {
stroke: "#000",
fill: "yellow",
left: 0,
top: 0,
shadow: {
color: "rgba(0,0,0,0.5)",
offsetX: 0,
offsetY: 0,
blur: 10
},
...props
});
return new fabric.Group([path]);
}; goes back to 60fps |
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. |
Not stale. Let's leave it opened to another people can found this issue and suggest solution |
After experimenting a bit it with #8298 I suggest:
This can be achieved in the current state of the code pretty much as well |
Truth be told #8298 doesn't really solve anything here. Only makes it simpler to instruct group to cache or not. |
Thank you for research, it looks very useful, i will try suggested approach and will leave feedback |
Version
5.2.1
Test Case
https://codesandbox.io/s/unruffled-black-bdcgfg
Information about environment
browser
Steps To Reproduce
Expected Behavior
60-120 FPS
Actual Behavior
8-12 FPS
If you will comment property
shadow
in functionmkObject
, you will have 60-120 FPS. The shadows it's our problem.How it may be fixed?
The text was updated successfully, but these errors were encountered: