mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
HackStudio: Take scrolling into consideration when painting breakpoints
Also, we now scroll to the currently executed line when execution is paused in the debugger.
This commit is contained in:
parent
c5eb20d0cc
commit
09ac22b37f
Notes:
sideshowbarker
2024-07-19 06:58:23 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/09ac22b37fb Pull-request: https://github.com/SerenityOS/serenity/pull/2097 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bugaevc
1 changed files with 4 additions and 0 deletions
|
@ -83,6 +83,9 @@ void Editor::focusout_event(Core::Event& event)
|
|||
Gfx::Rect Editor::breakpoint_icon_rect(size_t line_number) const
|
||||
{
|
||||
auto ruler_line_rect = ruler_content_rect(line_number);
|
||||
|
||||
auto scroll_value = vertical_scrollbar().value();
|
||||
ruler_line_rect = ruler_line_rect.translated({ 0, -scroll_value });
|
||||
auto center = ruler_line_rect.center().translated({ ruler_line_rect.width() - 10, -line_spacing() - 3 });
|
||||
constexpr int size = 32;
|
||||
return { center.x() - size / 2, center.y() - size / 2, size, size };
|
||||
|
@ -383,6 +386,7 @@ void Editor::navigate_to_include_if_available(String path)
|
|||
void Editor::set_execution_position(size_t line_number)
|
||||
{
|
||||
m_execution_position = line_number;
|
||||
scroll_position_into_view({ line_number, 0 });
|
||||
update(breakpoint_icon_rect(line_number));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue