From 6f373511426bedda3fada38a82ab69904941e5a0 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:32:58 -0500 Subject: [PATCH] LibGUI: Simplify DisplayOnly painting for TextEditor --- Userland/Libraries/LibGUI/TextEditor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 8e71d1ca3f..0aeae17aa7 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -418,16 +418,13 @@ void TextEditor::paint_event(PaintEvent& event) }; if (is_displayonly() && is_focused()) { - widget_background_color = palette().selection(); Gfx::IntRect display_rect { widget_inner_rect().x() + 1, widget_inner_rect().y() + 1, widget_inner_rect().width() - 2, widget_inner_rect().height() - 2 }; - painter.add_clip_rect(display_rect); - painter.add_clip_rect(event.rect()); - painter.fill_rect(event.rect(), widget_background_color); + painter.fill_rect(display_rect, palette().selection()); } painter.translate(frame_thickness(), frame_thickness());