LibWeb: Improve cursor appearance
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

`draw_rect` renders the outline of a rectangle.
`fill_rect` seems like a better option for rendering the cursor.
This commit is contained in:
zac 2025-07-16 22:08:09 +10:00 committed by Jelle Raaijmakers
commit 068974732f
Notes: github-actions[bot] 2025-07-31 11:08:15 +00:00

View file

@ -729,10 +729,9 @@ void paint_cursor_if_needed(PaintContext& context, TextPaintable const& paintabl
1, 1,
fragment_rect.height() fragment_rect.height()
}; };
auto cursor_device_rect = context.rounded_device_rect(cursor_rect).to_type<int>(); auto cursor_device_rect = context.rounded_device_rect(cursor_rect).to_type<int>();
context.display_list_recorder().draw_rect(cursor_device_rect, caret_color); context.display_list_recorder().fill_rect(cursor_device_rect, caret_color);
} }
void paint_text_decoration(PaintContext& context, TextPaintable const& paintable, PaintableFragment const& fragment) void paint_text_decoration(PaintContext& context, TextPaintable const& paintable, PaintableFragment const& fragment)