|
@@ -113,6 +113,7 @@ export default {
|
|
|
: 1
|
|
: 1
|
|
|
this.layerState = {
|
|
this.layerState = {
|
|
|
...this.layerState,
|
|
...this.layerState,
|
|
|
|
|
+ text: this.editLayer?.text ?? '',
|
|
|
fontSize: this.editLayer?.fontSize ?? 16,
|
|
fontSize: this.editLayer?.fontSize ?? 16,
|
|
|
lineHeight: this.editLayer?.lineHeight ?? 1,
|
|
lineHeight: this.editLayer?.lineHeight ?? 1,
|
|
|
charSpacing: this.editLayer?.charSpacing ?? 0,
|
|
charSpacing: this.editLayer?.charSpacing ?? 0,
|
|
@@ -184,6 +185,14 @@ export default {
|
|
|
this.createClipBackground();
|
|
this.createClipBackground();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 为图片对象添加尺寸变化监听
|
|
|
|
|
+ if (this.editLayer.type === 'image') {
|
|
|
|
|
+ // 移除之前可能的监听器
|
|
|
|
|
+ this.editLayer.off('scaling', this.updateImageSizeFromCanvas);
|
|
|
|
|
+ // 添加新的监听器
|
|
|
|
|
+ this.editLayer.on('scaling', this.updateImageSizeFromCanvas);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 同步描边图形(如果存在)
|
|
// 同步描边图形(如果存在)
|
|
|
if (this.editLayer.strokeObj) {
|
|
if (this.editLayer.strokeObj) {
|
|
|
this.fcanvas.add(markRaw(this.editLayer.strokeObj));
|
|
this.fcanvas.add(markRaw(this.editLayer.strokeObj));
|
|
@@ -198,6 +207,7 @@ export default {
|
|
|
: 1
|
|
: 1
|
|
|
this.layerState = {
|
|
this.layerState = {
|
|
|
...this.layerState,
|
|
...this.layerState,
|
|
|
|
|
+ text: this.editLayer?.text ?? '',
|
|
|
fontSize: this.editLayer?.fontSize ?? 16,
|
|
fontSize: this.editLayer?.fontSize ?? 16,
|
|
|
lineHeight: this.editLayer?.lineHeight ?? 1,
|
|
lineHeight: this.editLayer?.lineHeight ?? 1,
|
|
|
charSpacing: this.editLayer?.charSpacing ?? 0,
|
|
charSpacing: this.editLayer?.charSpacing ?? 0,
|