You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. First let me express my appreciation for your work on this library. Successfully marrying OSD and fabricjs is something I find very useful. I hope you can advice me on a couple of issues I run into trying to use it.
I have attempted to setup (according to your readme) a minimal working example for myself in a vue3 component but with mixed results.
There was a problem with imports
These two import statements turned out to be not enough. Component failed to compile, complaining about 'fabric' being undefined
import OpenSeadragon from 'openseadragon';
import { initOSDFabricJS } from 'openseadragon-fabric';
First I tried to change the import to this import { fabric, initOSDFabricJS } from 'openseadragon-fabric';
But it didn't work either, Then I simply imported fabricjs itself like this and the component compiled successfully import { fabric } from 'fabric';
Is it the correct way to set up imports or should I do something else?
2) Then there is a problem with expected behavior of fabricjs objects. For a simple test I just copied code from your readme to create a rectangle
The rectangle is drawn correctly, the problem is I can't select it for whatever reason. When I put my cursor over the rectangle it changes target-style as expected, but no matter how many times I click on it the rectangle is not selected, bounding frame with corners does not appear. What am I doing wrong here? Below is the full code of my component if it helps
Hi @ferropasha . Sorry for the delay, I only realized now that you had posted, I didn't see the notification.
Yes, you're correct. This version of the library didn't export any other library, just the functions that manage the FabricJS library.
So, to create a fabric object you still need to import the default FabricJS, as you say: import { fabric } from 'fabric';
About the interactions with the FabricJS, by default, the OpenSeaDragon library manages all interactions. So, to interact with the FabricJS canvas you'll need to disable the OSD default interactions using the following line:
//Needs to be set to false to disable default mouse navigation in OSD.
newViewer.setMouseNavEnabled(false);
Nowadays, this is the only way to interact with the FabricJS canvas, when you disable the OSD interactions.
Any other questions, send them here. I will pay more attention to this repo.
Thanks for the questions.
Hi. First let me express my appreciation for your work on this library. Successfully marrying OSD and fabricjs is something I find very useful. I hope you can advice me on a couple of issues I run into trying to use it.
I have attempted to setup (according to your readme) a minimal working example for myself in a vue3 component but with mixed results.
These two import statements turned out to be not enough. Component failed to compile, complaining about 'fabric' being undefined
First I tried to change the import to this
import { fabric, initOSDFabricJS } from 'openseadragon-fabric';
But it didn't work either, Then I simply imported fabricjs itself like this and the component compiled successfully
import { fabric } from 'fabric';
Is it the correct way to set up imports or should I do something else?
2) Then there is a problem with expected behavior of fabricjs objects. For a simple test I just copied code from your readme to create a rectangle
The rectangle is drawn correctly, the problem is I can't select it for whatever reason. When I put my cursor over the rectangle it changes target-style as expected, but no matter how many times I click on it the rectangle is not selected, bounding frame with corners does not appear. What am I doing wrong here? Below is the full code of my component if it helps
The text was updated successfully, but these errors were encountered: