1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibGUI+HackStudio: Simplify TextEditor gutter & ruler calculations

- Make gutter/ruler_content_rect() return rectangles relative to the
  TextEditor widget.
- Re-order painting code to translate the Painter after the gutter/ruler
  has been painted, to use those coordinates.
- Consistently put gutter before ruler in code, because that's the order
  they physically appear.
This commit is contained in:
Sam Atkins 2023-02-19 16:14:16 +00:00 committed by Andreas Kling
parent 3676f5085e
commit 1a5159df73
3 changed files with 32 additions and 31 deletions

View file

@ -121,7 +121,7 @@ void Editor::focusout_event(GUI::FocusEvent& event)
Gfx::IntRect Editor::gutter_icon_rect(size_t line_number) const
{
return gutter_content_rect(line_number).translated(ruler_width() + gutter_width() + frame_thickness(), -vertical_scrollbar().value());
return gutter_content_rect(line_number).translated(frame_thickness(), 0);
}
void Editor::paint_event(GUI::PaintEvent& event)