auto select rectangle after drawing
This commit is contained in:
parent
0e029b205d
commit
7bbf656e41
@ -114,6 +114,14 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
instance.annotManager.on('annotationChanged', (annotations) => {
|
||||||
|
// when a rectangle is drawn, it returns one annotation with tool name 'AnnotationCreateRectangle;
|
||||||
|
// this will auto select rectangle after drawing
|
||||||
|
if (annotations.length === 1 && annotations[0].ToolName === 'AnnotationCreateRectangle') {
|
||||||
|
instance.annotManager.selectAnnotations(annotations);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
instance.docViewer.on('pageNumberUpdated', (p) => {
|
instance.docViewer.on('pageNumberUpdated', (p) => {
|
||||||
if (this.shouldDeselectAnnotationsOnPageChange) {
|
if (this.shouldDeselectAnnotationsOnPageChange) {
|
||||||
this.instance.annotManager.deselectAllAnnotations();
|
this.instance.annotManager.deselectAllAnnotations();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user