diff --git a/Userland/Services/WindowServer/Button.cpp b/Userland/Services/WindowServer/Button.cpp index 6abd91e2c96..c6db1d34375 100644 --- a/Userland/Services/WindowServer/Button.cpp +++ b/Userland/Services/WindowServer/Button.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace WindowServer { @@ -23,7 +24,7 @@ Button::~Button() { } -void Button::paint(Gfx::Painter& painter) +void Button::paint(Screen& screen, Gfx::Painter& painter) { auto palette = WindowManager::the().palette(); Gfx::PainterStateSaver saver(painter); @@ -31,10 +32,11 @@ void Button::paint(Gfx::Painter& painter) Gfx::StylePainter::paint_button(painter, rect(), palette, Gfx::ButtonStyle::Normal, m_pressed, m_hovered); if (m_icon) { - auto icon_location = rect().center().translated(-(m_icon->width() / 2), -(m_icon->height() / 2)); + auto& bitmap = m_icon->bitmap(screen.scale_factor()); + auto icon_location = rect().center().translated(-(bitmap.width() / 2), -(bitmap.height() / 2)); if (m_pressed) painter.translate(1, 1); - painter.blit(icon_location, *m_icon, m_icon->rect()); + painter.blit(icon_location, bitmap, bitmap.rect()); } } diff --git a/Userland/Services/WindowServer/Button.h b/Userland/Services/WindowServer/Button.h index 90f5b440bc3..843d7c61d21 100644 --- a/Userland/Services/WindowServer/Button.h +++ b/Userland/Services/WindowServer/Button.h @@ -11,10 +11,12 @@ #include #include #include +#include namespace WindowServer { class MouseEvent; +class Screen; class WindowFrame; class Button : public Weakable