|
@@ -37,7 +37,8 @@ class ComPDFAnnotationLayer {
|
|
|
scale,
|
|
|
pageIndex,
|
|
|
eventBus,
|
|
|
- $t
|
|
|
+ $t,
|
|
|
+ freetextProperty
|
|
|
}) {
|
|
|
this._cancelled = false;
|
|
|
this.pageViewer = pageViewer
|
|
@@ -58,15 +59,6 @@ class ComPDFAnnotationLayer {
|
|
|
this.selectedElementName = null
|
|
|
this.addMode = false
|
|
|
this.toolMode = pageViewer.toolMode || ''
|
|
|
- this.freetextProperty = {
|
|
|
- fontSize: 14,
|
|
|
- textColor: '#000000',
|
|
|
- fontFamily: 'Helvetica',
|
|
|
- fontStyle: '',
|
|
|
- textAlignment: 'left',
|
|
|
- fontStyle: '',
|
|
|
- opacity: 1
|
|
|
- }
|
|
|
|
|
|
this.annotationStore = annotationStore
|
|
|
|
|
@@ -74,9 +66,10 @@ class ComPDFAnnotationLayer {
|
|
|
this.onHandleToolMode = this.handleToolMode.bind(this)
|
|
|
this.onHandlePropertyPanelChanged = this.handlePropertyPanelChanged.bind(this)
|
|
|
this.onHandleAddSign = this.addSign.bind(this)
|
|
|
- this.setFreetextProperty = this.setFreetextProperty.bind(this)
|
|
|
|
|
|
this.annotationStore.$t = $t
|
|
|
+
|
|
|
+ this.freetextProperty = freetextProperty
|
|
|
}
|
|
|
|
|
|
// 处理注释工具切换
|
|
@@ -668,7 +661,6 @@ class ComPDFAnnotationLayer {
|
|
|
this.eventBus._on('toolModeChanged', this.onHandleToolMode)
|
|
|
this.eventBus._on('setDefaultSelect', this.onHandleDefaultSelect)
|
|
|
this.eventBus._on('propertyPanelChanged', this.onHandlePropertyPanelChanged)
|
|
|
- this.eventBus._on('setFreetextProperty', this.setFreetextProperty)
|
|
|
|
|
|
if (viewport) {
|
|
|
const clonedViewport = viewport.clone({ dontFlip: true });
|
|
@@ -976,7 +968,6 @@ class ComPDFAnnotationLayer {
|
|
|
this.eventBus._off('toolModeChanged', this.onHandleToolMode)
|
|
|
this.eventBus._off('setDefaultSelect', this.onHandleDefaultSelect)
|
|
|
this.eventBus._off('propertyPanelChanged', this.onHandlePropertyPanelChanged)
|
|
|
- this.eventBus._off('setFreetextProperty', this.setFreetextProperty)
|
|
|
|
|
|
this.annotationStore.notFirstRender = true
|
|
|
}
|
|
@@ -1188,10 +1179,6 @@ class ComPDFAnnotationLayer {
|
|
|
this.eventBus.dispatch('changeSelectAvailable')
|
|
|
}
|
|
|
|
|
|
- setFreetextProperty (data) {
|
|
|
- Object.assign(this.freetextProperty, data)
|
|
|
- }
|
|
|
-
|
|
|
// 处理面板属性修改
|
|
|
handlePropertyPanelChanged (props) {
|
|
|
if (this.annotations && this.annotations.length) {
|