Hufe921 / canvas-editor

rich text editor by canvas/svg
https://hufe.club/canvas-editor-docs
MIT License
3.43k stars 498 forks source link

控件设置为非默认fontSize时,删除控件内容后placeholder文字大小异常 #691

Closed Manjusaka-N closed 1 month ago

Manjusaka-N commented 1 month ago

version

0.9.85

Link to minimal reproduction

No response

Steps to reproduce

控件单独设置size后,在控件中输入值再清空,placeholder文字大小恢复为defaultSize,而不是单独设置的size

What is expected?

清空控件时placeholder恢复为设置的size

// src/editor/core/draw/Draw.ts
// getElementFont方法 做以下调整是否有效
const size = el.control?.size ||el.actualSize || el.size || defaultSize

What is actually happening?

WechatIMG1041 WechatIMG1042 WechatIMG1043

System Info

No response

Any additional comments?

No response