-
-
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
controls not considered when using perPixelTargetFind if cache canvas is available #5443
Comments
i ll take a look asap. |
@asturur thank you! |
http://fabricjs.com/docs/fabric.Object.html#cornerStyle start to look from here and here: http://fabricjs.com/fabric-changelog-old ( scroll down to 1.6.2 ) Also here: http://fabricjs.com/controls-customization That does not mean your problem is solved, i wanted just to point out that writing code to render circle controls is not necessary. Said so i could not dig in your fiddle since the transpiled code is too much. How you draw the arrow should not be a problem here, just use a line. |
@asturur thank you for the links. My goal isn't to change the styling of standard controls (with 9 handles), my goals is to make completely custom controls with 2 handles on both ends of the arrow (inherited from Line class). I have simplified the snipped above by removing The problem is when you mousedown a thing rendered by Let me know is that clearer now. |
Yes, the problem was clear, i wonder how it happens since the standard controls are usable with perPixelTargetFind. My comment and links about the circle controls is that while you probably need to rewrite the function that render borders and call the function that draw the single controls, the exact function that draw the controls should be fine |
Ok, the control does not work because you set hasControls to false. An easier way to handle this would be:
|
I've set the option to true, but it doesn't work anyway. IMO that's another bug: if
That looks like a tricky hack... I'm thinking to move controls rendering to
|
http://jsfiddle.net/Da7SP/3344/ There is for sure a bug that stops you from making your code work, and that can you work around disabling objectCaching for your subclass. And the bug should be fixed somehow. Then my comment about the code is more about the fact that just rendering controls where you want will not make the controls easily targetable in other situations, is also true that i did not read the full code of the first fiddle and i have no idea how other things are handled. About the trick hack i feel like those are similar way to get to the same result. You should override the simpler functions or the one with which you are most comfortable with if there is more than an option. There is a connection between oCoords and controls rendering and control radius, you should keep those things as much as working together as possible. |
@asturur thank you. |
i m fixing the bug we surfaced, this may fix or not fix your use case, i have no idea. |
@asturur any news about an official release? |
i think i ll go for this sunday now that the gradient export is in too. |
This is a wonderful drag effect about the arrowLine, wiil you please update it after asturur's method in http://jsfiddle.net/Da7SP/3344/ ? |
@Hellowor1d a company I work for is planning to open source an ambitious image editor (but not earlier than in a month). Line arrow class is going to be open sourced as well. |
Hi~ , has been the ambitious image editor published? waiting for your good news |
@Hellowor1d not yet :( |
I faced the same issue (maybe), and in my case, it is because of the And I have no idea how to fix it. Tried somethings but still doesn't work. |
Figured it out!
32 is my control's size, replace with yours. |
Version
2.4.5
Test Case
http://jsfiddle.net/Da7SP/3322/
The test case is quite complicated because I had to transpile the code via babel. But the idea is simple: I want to render custom controls (blue circles) by
_renderControls
outside of the object (red arrow) itself (at "transparent zone") and useperPixelTargetFind: true
.Information about environment
Chrome 71
Steps to reproduce
Try to use handles (blue circles). First try to mousedown an intersect of a handle and the red arrow. Then try to mousedown the handle outside of the arrow.
Expected Behavior
The handles should be included at "perPixelTargetFind" zone.
Actual Behavior
When a handle is moused down outside of the arrow area, the arrow becomes inactive. It worked fine at 2.0.0-rc.4 if I set
padding: "any number more than handle radius"
but doesn't work anymore at latest version. The gif above is made using the old version of fabricjs.The text was updated successfully, but these errors were encountered: