recogito-client-plugins icon indicating copy to clipboard operation
recogito-client-plugins copied to clipboard

Fixed size rectangles

Open m1stermanager opened this issue 3 years ago • 2 comments

I think I can hack together something for this, but it would be great if I could force certain annotations to be a fixed size. In our use case, we want to have very very consistent image tags, so removing the user's ability to set or resize would be great.

I would picture it as a button outside of the annotation where I can programmatically include an annotation config option with height, width, and resizable on options?

if resize is false AND:

  • you set a static height, it cannot be changed
  • you set a static width, it cannot be changed

if resize is true and either is set, it is the initial value but can be changed.

If you think this would be useful I would actually love to attempt to contribute a change for it.

The workaround I can think of now is subscribing to an event, seeing if the annotation label matches one of our fixed size options, and forcing the size in the event the user has attempted to resize.

m1stermanager avatar Jul 15 '21 21:07 m1stermanager

I agree, this could be useful to others. I wouldn't see it as a core feature though. IMO this would work really well as a plugin.

The workaround you're suggesting would currently work I think. It's not possible to update the shape programmatically while the annotation is being edited. The way to do it would be to write your own tool (something like a "Fixed Size Rectangle Tool" plugin). That would take pre-set width and height as config options, and only allow move when it's being edited, but not resize.

The Selector Pack provides a basic framework + examples for how to build tool plugins. The original rectangle plugin is part of the core codebase here, and should be reusable almost completely.

rsimon avatar Jul 16 '21 05:07 rsimon

awesome. thanks for the quick reply. I'll take some time to look into this. this is a super cool project and your responsiveness is WILD.

let me poke around a bit and see if I can come up with something! I may have a little time this weekend to get my feet wet, but my schedule is a little crazy sometimes

m1stermanager avatar Jul 16 '21 13:07 m1stermanager