Replies: 4 comments 5 replies
|
I just figured out why I couldn't get this to work. I notice that the filters object is frozen, that's why it wasn't working before. Anyway, I can remove the frozen tag and get my custom filters to work, so no real issue now. My question is: Do you plan on adding any ability for custom filters in V6? Loving the new version BTW - some serious work gone into it. Thank you so much for your time and effort guys, it's really appreciated. |
|
Happy to hear Something like this: |
|
Thanks so much for your help, that's very similar to what I had but I needed to include a isNeutralState function to return false or there was an error. Here's what worked for me, hope this helps somebody else. `class Greenify extends fabric.filters.BaseFilter { static type = 'Greenify' getFragmentSource() { applyTo2d(options) { } isNeutralState() { }; Is there a new way to apply filters, other than: applyFilter(0, new Greenify()) ? |
|
So, after some time on this I have another issue that I'm not sure if it's missing a V6 feature or there may already be a way? If I add a filter to an object, export as JSON and import back in, there's an error because the system does not know about Greenify Filter: Uncaught (in promise) Error: fabric: No class registered for Greenify Is there a way, in V6, of adding the Greenify filter so that it is included when using loadFromJSON |
Uh oh!
There was an error while loading. Please reload this page.
Hi Guys,
Finally managed to get V6 built and up and running. I'm getting my head around some of the changes and making good progress.
However, I am struggling with custom filters though.
No, I am aware that createClass and object.util.extend have been removed and that I should use getDefaults but I'm struggling with the concept at the moment.
Could somebody please explain how you port the following from V5 to V6: It's about the simplest filter I could find:
I prefer to keep custom filters inside their own .js file and call them when needed
Thanks very much for any help with this
All reactions