diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-26 02:08:28 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-26 02:46:26 +0200 |
commit | 9b2fb4713680334c6b56f6871103319dbfaf5d5a (patch) | |
tree | 249e161a71f1d60806d50dee58de99255b45642a /LibGUI | |
parent | 9308ce071f6208a20a7abc087d00be227d1be9ee (diff) | |
download | serenity-9b2fb4713680334c6b56f6871103319dbfaf5d5a.zip |
GTextEditor: Take frame size into account when setting clip rect
The ruler right does not include the (already translated) frame size.
Take that into account too, otherwise we overdraw the ruler.
Fixes #23.
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GTextEditor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/LibGUI/GTextEditor.cpp b/LibGUI/GTextEditor.cpp index 44f1947c54..4c85f13ae0 100644 --- a/LibGUI/GTextEditor.cpp +++ b/LibGUI/GTextEditor.cpp @@ -292,7 +292,7 @@ void GTextEditor::paint_event(GPaintEvent& event) } } - painter.add_clip_rect({ m_ruler_visible ? (ruler_rect.right() + 1) : 0, 0, width() - width_occupied_by_vertical_scrollbar() - ruler_width(), height() - height_occupied_by_horizontal_scrollbar() }); + painter.add_clip_rect({ m_ruler_visible ? (ruler_rect.right() + frame_thickness() + 1) : frame_thickness(), frame_thickness(), width() - width_occupied_by_vertical_scrollbar() - ruler_width(), height() - height_occupied_by_horizontal_scrollbar() }); for (int i = first_visible_line; i <= last_visible_line; ++i) { auto& line = *m_lines[i]; |