|
@@ -80,7 +80,8 @@ class ComPDFAnnotationLayer {
|
|
|
this.pageViewer.color = color
|
|
|
|
|
|
if (!this.svgElement) {
|
|
|
- this.svgElement = this.pageDiv.querySelector('.annotationLayer svg')
|
|
|
+ this.destroy()
|
|
|
+ this.renderPaintScene()
|
|
|
}
|
|
|
|
|
|
const markup = ['highlight', 'underline', 'squiggly', 'strikeout']
|
|
@@ -920,9 +921,15 @@ class ComPDFAnnotationLayer {
|
|
|
|
|
|
// 画布重置
|
|
|
destroy () {
|
|
|
- this.svgElement.remove()
|
|
|
+ if (!this.svgElement) {
|
|
|
+ this.svgElement = this.pageDiv.querySelector('.annotationLayer svg')
|
|
|
+ }
|
|
|
+ this.svgElement?.remove()
|
|
|
this.svgElement = null
|
|
|
- this.div.remove()
|
|
|
+ if (!this.div) {
|
|
|
+ this.div = this.pageDiv.querySelector('.annotationContainer')
|
|
|
+ }
|
|
|
+ this.div?.remove()
|
|
|
this.div = null
|
|
|
if (this.freetextManager) {
|
|
|
this.freetextManager.reset()
|