1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:15:07 +00:00

WindowServer: Store the mouse button state in one variable.

This makes the logic around it a lot less verbose.
This commit is contained in:
Andreas Kling 2019-03-05 14:11:46 +01:00
parent 26a9d662f4
commit f3ff402cf3
4 changed files with 25 additions and 51 deletions

View file

@ -958,7 +958,7 @@ void WSWindowManager::draw_cursor()
Rect cursor_rect { cursor_location.x(), cursor_location.y(), (int)m_cursor_bitmap_inner->width(), (int)m_cursor_bitmap_inner->height() };
Color inner_color = Color::White;
Color outer_color = Color::Black;
if (m_screen.left_mouse_button_pressed())
if (m_screen.mouse_button_state() & (unsigned)MouseButton::Left)
swap(inner_color, outer_color);
m_back_painter->draw_bitmap(cursor_location, *m_cursor_bitmap_inner, inner_color);
m_back_painter->draw_bitmap(cursor_location, *m_cursor_bitmap_outer, outer_color);