Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wangtao1025 opened this issue Sep 20, 2024 · 2 comments
Open

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

wangtao1025 opened this issue Sep 20, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@wangtao1025
Copy link

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 wangtao1025 changed the title 当标题中同时存在中文和英文时光标会不准确 当文本中连续输入英文字母 f 时 光标会不准确 Sep 20, 2024
@Hufe921
Copy link
Owner

Hufe921 commented Sep 20, 2024

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

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

@Hufe921 Hufe921 added the enhancement New feature or request label Sep 23, 2024
@claviering
Copy link
Contributor

claviering commented Oct 10, 2024

连续输入数字 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 added a commit to claviering/canvas-editor that referenced this issue Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants