How to Apply Custom Controls Globally to All Canvas Elements in Fabric.js v6.5.3? #10336
Unanswered
aayushmaan-54
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Please read this doc here that has been written on purpose Let me know if it answers your questions and if is clear. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question:
I am using Fabric.js v6.5.3 to create a canvas editor and want to implement custom controls for all canvas elements. I wrote a custom hook, useEditor, to initialize the canvas and manage its lifecycle. Additionally, I created custom controls using the createCircleControls function in controls.ts. However, I am struggling to apply these custom controls globally to all canvas elements.
Here’s what I have so far:
useEditor.tsx
controls.ts
drawer.ts
Editor.ts
What i have tried
I can successfully apply custom controls to a specific object like this:
However, I want these custom controls to apply to all canvas elements automatically. this is only appling to test rect i made
How can I apply custom controls globally to all objects on the Fabric.js canvas? Is there a way to override the default controls for all canvas elements?
Beta Was this translation helpful? Give feedback.
All reactions