Closed nikhiilll closed 1 year ago
In Safari, we couldn't figure out how to show the handler for resizing the textbox, so for now, that feature is not used in Safari.
Everything else seems to be working as expected. I will merge this PR and get back to the Safari issue later.
Text Annotation
Added the text annotation functionality. To implement the text annotation, we are using a ForeignObject inside the annotation SVG. We use a Textarea input to let the user type and get the text. Once the user starts drawing another annotation, we transform the input to a p tag containing the same text and styling that the user had.
Changes
annotationContainer.css
: Added styling for the textbox functionality and the font size inputannotation-tool.js
: Added the text annotation tool option, font size input and handling for annotation-specific functionsannotation-group.js
: Changes to handle the creation and import of text annotationannotation-svg.js
: Changes to handle font size change and parsing of text/foreign object nodesbase.js
: Small changes to handle the export for text annotationtext.js
: Added this file which contains all the text annotation functionalityviewer.js
: Implemented functions to implement mouse handlers to handle the positioning of text annotationmview.html
: Added the import for the text annotation file