|
@@ -311,6 +311,8 @@ export class TextEditor {
|
|
|
this.addUndoHistory()
|
|
|
this.newAdd = false
|
|
|
}
|
|
|
+
|
|
|
+ this.updateCanvas()
|
|
|
}
|
|
|
|
|
|
getActualRect (viewport, s, frame) {
|
|
@@ -607,7 +609,9 @@ export class TextEditor {
|
|
|
this.textContainer,
|
|
|
this.outerLine,
|
|
|
document.querySelector('.editor-panel'),
|
|
|
- document.getElementById('propertyPanelButton')
|
|
|
+ document.getElementById('propertyPanelButton'),
|
|
|
+ document.getElementById('undo'),
|
|
|
+ document.getElementById('redo')
|
|
|
], this.handleOutside.bind(this))
|
|
|
}
|
|
|
}
|
|
@@ -795,7 +799,9 @@ export class TextEditor {
|
|
|
this.textContainer,
|
|
|
this.outerLine,
|
|
|
document.querySelector('.editor-panel'),
|
|
|
- document.getElementById('propertyPanelButton')
|
|
|
+ document.getElementById('propertyPanelButton'),
|
|
|
+ document.getElementById('undo'),
|
|
|
+ document.getElementById('redo')
|
|
|
], this.handleOutside.bind(this))
|
|
|
return
|
|
|
}
|
|
@@ -838,7 +844,9 @@ export class TextEditor {
|
|
|
this.textContainer,
|
|
|
this.outerLine,
|
|
|
document.querySelector('.editor-panel'),
|
|
|
- document.getElementById('propertyPanelButton')
|
|
|
+ document.getElementById('propertyPanelButton'),
|
|
|
+ document.getElementById('undo'),
|
|
|
+ document.getElementById('redo')
|
|
|
], this.handleOutside.bind(this))
|
|
|
}
|
|
|
}
|
|
@@ -1150,11 +1158,16 @@ export class TextEditor {
|
|
|
editAreaPtr: this.editAreaPtr,
|
|
|
char: this.activeCharPlace
|
|
|
})
|
|
|
- style.fontFamily = fontName
|
|
|
+ fontName && (style.fontFamily = fontName)
|
|
|
|
|
|
this.textStyle = style
|
|
|
|
|
|
- this.eventBus.dispatch('contentPropertyChange', { type: 'text', ...style })
|
|
|
+ const alignType = await this.messageHandler.sendWithPromise('GetTextSectionAlignType', {
|
|
|
+ editAreaPtr: this.editAreaPtr,
|
|
|
+ char: this.activeCharPlace
|
|
|
+ })
|
|
|
+
|
|
|
+ this.eventBus.dispatch('contentPropertyChange', { type: 'text', ...style, alignType })
|
|
|
}
|
|
|
|
|
|
// 某个操作之后,获取光标所在字符的位置
|
|
@@ -1674,7 +1687,9 @@ export class TextEditor {
|
|
|
this.textContainer,
|
|
|
this.outerLine,
|
|
|
document.querySelector('.editor-panel'),
|
|
|
- document.getElementById('propertyPanelButton')
|
|
|
+ document.getElementById('propertyPanelButton'),
|
|
|
+ document.getElementById('undo'),
|
|
|
+ document.getElementById('redo')
|
|
|
],this.handleOutside.bind(this))
|
|
|
}
|
|
|
|
|
@@ -1708,8 +1723,8 @@ export class TextEditor {
|
|
|
this.state = 0
|
|
|
// await this.handleOutside()
|
|
|
|
|
|
- this.outerLine.remove()
|
|
|
- this.frameContainer.remove()
|
|
|
+ this.outerLine?.remove()
|
|
|
+ this.frameContainer?.remove()
|
|
|
this.frameContainer = null
|
|
|
this.contentContainer.selectedFrameIndex = -1
|
|
|
this.removed = true
|
|
@@ -1804,6 +1819,8 @@ export class TextEditor {
|
|
|
|
|
|
this.drawCanvas()
|
|
|
this.saveEdit()
|
|
|
- this.contentContainer.selectedFrameIndex === this.editAreaIndex && this.getTextStyle()
|
|
|
+ if (this.contentContainer.selectedFrameIndex === this.editAreaIndex) {
|
|
|
+ this.getTextStyle()
|
|
|
+ }
|
|
|
}
|
|
|
}
|