The Wayback Machine - https://web.archive.org/web/20200909010323/https://github.com/mifi/editly/issues/37
Skip to content
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

CustomFabricSoure does not accept parameters #37

Open
santhoshtr opened this issue May 2, 2020 · 2 comments
Open

CustomFabricSoure does not accept parameters #37

santhoshtr opened this issue May 2, 2020 · 2 comments

Comments

@santhoshtr
Copy link

@santhoshtr santhoshtr commented May 2, 2020

The func value set of type:fabric customFabricFrameSource does not recieve any parameters. For example, you cannot pass a text to https://github.com/mifi/editly/blob/master/examples/customFabric.js.

Following patch can fix it.

diff --git a/sources/fabricFrameSource.js b/sources/fabricFrameSource.js
index 74b8299..c88238c 100644
--- a/sources/fabricFrameSource.js
+++ b/sources/fabricFrameSource.js
@@ -308,7 +308,7 @@ async function createCustomCanvasFrameSource({ width, height, params }) {
 }
 
 async function customFabricFrameSource({ canvas, width, height, params }) {
-  return params.func(({ width, height, fabric, canvas }));
+  return params.func(({ width, height, fabric, canvas, params }));
 }
 
 function registerFont(...args) {
@willhalling
Copy link

@willhalling willhalling commented Jun 9, 2020

Thanks for this. I was looking for a way to add to multiple fabric elements to the page so I need the params to work.

@mifi I have a video where I need more than one custom fabric element. Is there a better approach than using params?

By the way, amazing library by the way, very impressive.

@mifi
Copy link
Owner

@mifi mifi commented Jul 13, 2020

@willhalling I'm not sure I understand what you need. I agree params could be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.