Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Issue using Fancybox and Polygon on the same image #195

Open
arvitl opened this issue Apr 6, 2018 · 2 comments
Open

Issue using Fancybox and Polygon on the same image #195

arvitl opened this issue Apr 6, 2018 · 2 comments

Comments

@arvitl
Copy link

arvitl commented Apr 6, 2018

Hi,

I am evaluating you tool for some dev work. I want to provide users the option to draw box(es) or polygon(s) on an image for annotations. It works fine if I switch from box to ploygon and then to box. However, if I want to change to polygon after that (box --> ploygon --> box --> polygon OR ploygon --> box --> polygon), the polygon drawing on the screen behaves in a weird manner. I have buttons on the page for the users to click on to choose drawing box or polygon. Following is the code to change the shape.

   if (annotateShape == 'polygon') {
      anno.addPlugin('PolygonSelector', { activate: true });
    }
    else {
      anno.addPlugin('FancyBoxSelector', { activate: true });
    }

Could you please let me know if this is the only way.

Also, is there a way to remove an added plugin?
I tried: anno.addPlugin('PolygonSelector', { activate: false });, but it did not work.

Thanks in advance

@wuliupo
Copy link

wuliupo commented Jan 31, 2019

Yes, I also have the problem "how to disable an plugin" .
If you have that solution, could you please tell me how to do?
Thank you @arvitl !

@wuliupo
Copy link

wuliupo commented Jan 31, 2019

@arvitl
I have a solution! you can rest the anno before add plugin.

anno.reset();
if (annotateShape == 'polygon') {
    anno.addPlugin('PolygonSelector', { activate: true });
} else {
    anno.addPlugin('FancyBoxSelector', { activate: true });
}

It works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants