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

Add config option to enable resizing of rects via edges #275

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

derek-young
Copy link
Contributor

This PR adds a property to the config object, enableEdgeControls, that defaults to false but when enabled allows for adjusting an Annotorious EditableRect via its edges. This is in response to a recent discussion: #274

@vidya-talapady-percipient-ai
Copy link

simon

@rsimon
Copy link
Member

rsimon commented Feb 16, 2023

Thanks for this PR. I still need to find some time to test it. But at first glance, this looks great!

Only one thing: I think this is generally useful to everyone. Therefore I don't think it would even have to be a configurable option. I'd just make it the default. (I would probably set the next version number to 2.8.0 rather than 2.7.11, due to the behavior change.) I'll probably make that change after testing & merging - but feel free to amend the PR, if you want and have the time.

Cheers,
Rainer

@derek-young
Copy link
Contributor Author

Sounds good @rsimon. The reason I thought perhaps it should be configurable is because the handles can be somewhat large relative to the size of the label, so depending on how small the user's labels are they may not want the additional clutter of the edge handles? Not sure...

Let me know what you think after you've gotten a chance to test, if you'd still like this to be the default behavior I'm happy to make that change.

@rsimon rsimon merged commit adf59d9 into annotorious:main Feb 21, 2023
@rsimon
Copy link
Member

rsimon commented Feb 21, 2023

Thanks - merging this now. I agree though that it makes sense to keep it a configurable option. I only realized just now when testing, that you made edges draggable via extra circle handles. I think I would have done it in a different style, making the edges themselves draggable. (Possibly by adding transparent SVG lines above the edges, a few pixels wide, so that they are easier to grab.) You could also use CSS to change the cursor to the appropriate cursor style (ew-resize or ns-resize). But this version is definitely a helpful start!

@derek-young derek-young deleted the rect-edge-controls branch February 22, 2023 17:08
@darshanvss
Copy link

how do I use the edge handles? I have tried making the same changes in my node module files following the commits as it's still showing 2.7.10 as latest, but I am not able to get the annotations have the edge handles. Should I use the EditableRect using the addDrawingTool and setDrawingTool? I am trying to implement it in VueJS.

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

Successfully merging this pull request may close these issues.

None yet

4 participants