Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Fixed size rectangles #9

Open
m1stermanager opened this issue Jul 15, 2021 · 2 comments
Open

Fixed size rectangles #9

m1stermanager opened this issue Jul 15, 2021 · 2 comments
Labels
plugin idea Idea for a new plugin

Comments

@m1stermanager
Copy link

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.

@rsimon
Copy link
Member

rsimon commented Jul 16, 2021

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.

@m1stermanager
Copy link
Author

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

@rsimon rsimon transferred this issue from annotorious/annotorious Sep 11, 2021
@rsimon rsimon added the plugin idea Idea for a new plugin label Oct 10, 2021
@rsimon rsimon changed the title Feature Request: Fixed size annotations Fixed size rectangles Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin idea Idea for a new plugin
Projects
None yet
Development

No branches or pull requests

2 participants