canvas-editor icon indicating copy to clipboard operation
canvas-editor copied to clipboard

当文本中连续输入英文字母 f 时 光标会不准确

Open wangtao1025 opened this issue 1 year ago • 1 comments

version

latest

Link to minimal reproduction

No response

Steps to reproduce

官网 demo 中在中文标题中间插入多个英文字符会造成光标位置不准确 Snipaste_2024-09-20_17-22-51

What is expected?

光标准确

What is actually happening?

Editor Value

No response

System Info

No response

Any additional comments?

No response

wangtao1025 avatar Sep 20 '24 09:09 wangtao1025

先配置使用渲染兼容模式:

const options: IEditorOption = {
  renderMode: RenderMode.COMPATIBILITY
}

Hufe921 avatar Sep 20 '24 10:09 Hufe921

连续输入数字 1 也会出现光标位置不准确

ctx.font = '24px Microsoft YaHei';
ctx.measureText("1").width * 2 !== ctx.measureText("11").width
// ctx.measureText("1").width: 12
// ctx.measureText("11").width: 23.12109375

claviering avatar Oct 10 '24 09:10 claviering