From bfa9ae809f28d3480858c391928b05a44f432f3e Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 28 Sep 2022 12:27:19 +0100 Subject: LibCards+Games: Rename "draw" methods to "paint" for clarity "Draw" is already a card-game term so using it for graphics was confusing me a lot! --- Userland/Libraries/LibCards/Card.cpp | 6 +++--- Userland/Libraries/LibCards/Card.h | 4 ++-- Userland/Libraries/LibCards/CardStack.cpp | 6 +++--- Userland/Libraries/LibCards/CardStack.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Userland/Libraries') diff --git a/Userland/Libraries/LibCards/Card.cpp b/Userland/Libraries/LibCards/Card.cpp index 8bb98e2d55..42f757c38a 100644 --- a/Userland/Libraries/LibCards/Card.cpp +++ b/Userland/Libraries/LibCards/Card.cpp @@ -20,7 +20,7 @@ Card::Card(Suit suit, Rank rank) VERIFY(to_underlying(rank) < card_count); } -void Card::draw(GUI::Painter& painter) const +void Card::paint(GUI::Painter& painter) const { auto& card_painter = CardPainter::the(); auto bitmap = [&]() { @@ -43,12 +43,12 @@ void Card::save_old_position() m_old_position_valid = true; } -void Card::clear_and_draw(GUI::Painter& painter, Color const& background_color) +void Card::clear_and_paint(GUI::Painter& painter, Color const& background_color) { if (is_old_position_valid()) clear(painter, background_color); - draw(painter); + paint(painter); save_old_position(); } diff --git a/Userland/Libraries/LibCards/Card.h b/Userland/Libraries/LibCards/Card.h index ec4255807b..8a18e5d90d 100644 --- a/Userland/Libraries/LibCards/Card.h +++ b/Userland/Libraries/LibCards/Card.h @@ -106,9 +106,9 @@ public: void save_old_position(); - void draw(GUI::Painter&) const; + void paint(GUI::Painter&) const; void clear(GUI::Painter&, Color const& background_color) const; - void clear_and_draw(GUI::Painter&, Color const& background_color); + void clear_and_paint(GUI::Painter& painter, Color const& background_color); private: Card(Suit, Rank); diff --git a/Userland/Libraries/LibCards/CardStack.cpp b/Userland/Libraries/LibCards/CardStack.cpp index 591df4f054..ad01cc9736 100644 --- a/Userland/Libraries/LibCards/CardStack.cpp +++ b/Userland/Libraries/LibCards/CardStack.cpp @@ -42,7 +42,7 @@ void CardStack::clear() m_stack_positions.clear(); } -void CardStack::draw(GUI::Painter& painter, Gfx::Color const& background_color) +void CardStack::paint(GUI::Painter& painter, Gfx::Color const& background_color) { auto draw_background_if_empty = [&]() { size_t number_of_moving_cards = 0; @@ -89,13 +89,13 @@ void CardStack::draw(GUI::Painter& painter, Gfx::Color const& background_color) if (m_rules.shift_x == 0 && m_rules.shift_y == 0) { auto& card = peek(); - card.draw(painter); + card.paint(painter); return; } for (auto& card : m_stack) { if (!card.is_moving()) - card.clear_and_draw(painter, Gfx::Color::Transparent); + card.clear_and_paint(painter, Gfx::Color::Transparent); } } diff --git a/Userland/Libraries/LibCards/CardStack.h b/Userland/Libraries/LibCards/CardStack.h index 52356fe40d..390ff2e850 100644 --- a/Userland/Libraries/LibCards/CardStack.h +++ b/Userland/Libraries/LibCards/CardStack.h @@ -52,7 +52,7 @@ public: bool is_allowed_to_push(Card const&, size_t stack_size = 1, MovementRule movement_rule = MovementRule::Alternating) const; void add_all_grabbed_cards(Gfx::IntPoint const& click_location, NonnullRefPtrVector& grabbed, MovementRule movement_rule = MovementRule::Alternating); - void draw(GUI::Painter&, Gfx::Color const& background_color); + void paint(GUI::Painter&, Gfx::Color const& background_color); void clear(); private: -- cgit v1.2.3