🐛 Fix text editor cursor being too thin on dpr > 1 (#10501)

This commit is contained in:
Belén Albeza 2026-07-01 10:43:59 +02:00 committed by GitHub
parent 782adffec8
commit 51877c4bca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,7 @@ pub fn render_overlay(
}
if editor_state.cursor_visible {
render_cursor(canvas, zoom, editor_state, text_content, shape);
render_cursor(canvas, zoom, options.dpr, editor_state, text_content, shape);
}
canvas.restore();
@ -39,6 +39,7 @@ pub fn render_overlay(
fn render_cursor(
canvas: &Canvas,
zoom: f32,
dpr: f32,
editor_state: &TextEditorState,
text_content: &TextContent,
shape: &Shape,
@ -54,7 +55,7 @@ fn render_cursor(
if editor_state.is_overtype_mode {
rect.width()
} else {
editor_state.theme.cursor_width / zoom
editor_state.theme.cursor_width / zoom * dpr
},
rect.height(),
);