-
-
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
Stop Render on Mouse Events #5253
Comments
The code shown is for the spraybrush, that is active just on the spray brush usage. For general mouse events you get render generally when they are needed. So selecting a shape requires drawing controls and you need a render ( moving controls somewherelse is a future thing to do ) Not having selection active should not render indeed. |
@asturur Whoops, followed the wrong code. 😄 So for the canvas I'm setting
And I still see a render when I select an object/group. Added a gif below where I added a |
if only mousedown and mouse events are fired, no it should not render. If you can reproduce in a fiddle we can mark it as a bug |
http://jsfiddle.net/Da7SP/3045/ Here is a fiddle reproducing. Every time a click happens in the canvas, it'll show a render, clicking the group shows two renders. |
Definitely a bug. There is code in fabricjs to render just when necessary, we broke it somehow. We need some sort of interaction tests that can catch those things, i tried to build a lib but is not really easy to have something that will work in node and browsers under qunit. |
FIY if you want to check the PR The logic was very old and untouched, i had no way to figure out when it broke, i hope this logic is more clear and more easy to read and check what it should do. Another thing, a quick and easy way to see if the canvas is rendering is to use:
|
👏 That was fast! Thanks for the tip, this is awesome! |
While using a canvas with a lot of shapes, we'd like to disable the rendering the occurs when clicking on an object -- while still being able to click on a shape and get it's information (ie. staticCanvas won't work). Tried turning off selection and AddOrRemoveShape, but the mouse events seem to still fire a render. Is there a way to capture the mouse event, but prevent fabric from performing a rerender? Or can turning off selection for the whole canvas stop the rerender?
Version
2.3.5
Steps to reproduce
n/a
Expected Behavior
Add ability to turn off mouse down/up rendering if selection + AddOrRemoveShape is disabled
Actual Behavior
The text was updated successfully, but these errors were encountered: