Prevent TextBox jitter during caret blink

This commit is contained in:
fanlusky committed 2026-06-16 22:30:04 +08:00
1 parent b59939dabe
commit e72c2c8b60
2 files changed
+1 -1

No files matched your search

+1
View File
@@ -87,6 +87,7 @@
- 微调了 `TextBox` caret 的绘制位置:插入光标现在以字符边界为中心绘制,不会再明显压到后一个字上
- 继续微调了 `TextBox` caret 的视觉位置:在保持字符边界对齐的前提下,插入光标额外轻微向左偏移,和后一个字之间会留出更自然的呼吸感
- 修正了单行 `TextBox` 在文本溢出时按左箭头的横向滚动行为:现在会优先让 caret 正常向左移动,只有文本整体变短时才回收多余的右侧滚动量
- 修复了单行 `TextBox` 在文本溢出时 caret 闪烁导致整段文本左右抖动的问题:纯 blink 重绘不再重复触发布局更新和滚动校正
## 构建
-1
View File
@@ -259,7 +259,6 @@ void CTextEditor::Render(ID2D1HwndRenderTarget *pRenderTarget)
return;
}
UpdateLayout();
_layout.Render(pRenderTarget, GetTextBuffer(), GetTextLength(), _nSelStart, _nSelEnd, _pCompositionRenderInfo,
_nCompositionRenderInfo);
}