summaryrefslogtreecommitdiff
path: root/Userland/Games/Solitaire
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2021-04-12 11:47:09 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-02 22:48:06 +0200
commit88cfaf7bf0ad2d5d3adb2654a5f7cc5b810a3ccd (patch)
tree47ec61dc9f8fb3ef9867be1cda3db5568e9b6686 /Userland/Games/Solitaire
parentac238b3bd63e47a334c6859ddb6570b89f7be3dc (diff)
downloadserenity-88cfaf7bf0ad2d5d3adb2654a5f7cc5b810a3ccd.zip
LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where appropriate. It also renamed the various move_by methods to translate_by, as that more closely matches the transformation terminology.
Diffstat (limited to 'Userland/Games/Solitaire')
-rw-r--r--Userland/Games/Solitaire/CardStack.cpp4
-rw-r--r--Userland/Games/Solitaire/SolitaireWidget.cpp2
-rw-r--r--Userland/Games/Solitaire/SolitaireWidget.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Games/Solitaire/CardStack.cpp b/Userland/Games/Solitaire/CardStack.cpp
index e1b830977b..d859678507 100644
--- a/Userland/Games/Solitaire/CardStack.cpp
+++ b/Userland/Games/Solitaire/CardStack.cpp
@@ -164,9 +164,9 @@ void CardStack::push(NonnullRefPtr<Card> card)
if (size && size % m_rules.step == 0) {
if (peek().is_upside_down())
- top_most_position.move_by(m_rules.shift_x, m_rules.shift_y_upside_down);
+ top_most_position.translate_by(m_rules.shift_x, m_rules.shift_y_upside_down);
else
- top_most_position.move_by(m_rules.shift_x, m_rules.shift_y);
+ top_most_position.translate_by(m_rules.shift_x, m_rules.shift_y);
}
if (m_type == Stock)
diff --git a/Userland/Games/Solitaire/SolitaireWidget.cpp b/Userland/Games/Solitaire/SolitaireWidget.cpp
index 2e6f740b4d..f42cab19a1 100644
--- a/Userland/Games/Solitaire/SolitaireWidget.cpp
+++ b/Userland/Games/Solitaire/SolitaireWidget.cpp
@@ -256,7 +256,7 @@ void SolitaireWidget::mousemove_event(GUI::MouseEvent& event)
for (auto& to_intersect : m_focused_cards) {
mark_intersecting_stacks_dirty(to_intersect);
- to_intersect.rect().move_by(dx, dy);
+ to_intersect.rect().translate_by(dx, dy);
}
m_mouse_down_location = click_location;
diff --git a/Userland/Games/Solitaire/SolitaireWidget.h b/Userland/Games/Solitaire/SolitaireWidget.h
index eeef14b963..a7d0b95553 100644
--- a/Userland/Games/Solitaire/SolitaireWidget.h
+++ b/Userland/Games/Solitaire/SolitaireWidget.h
@@ -46,9 +46,9 @@ private:
if (m_animation_card->position().y() + Card::height + m_y_velocity > SolitaireWidget::height + 1 && m_y_velocity > 0) {
m_y_velocity = min((m_y_velocity * -m_bouncyness), -8.f);
m_animation_card->rect().set_y(SolitaireWidget::height - Card::height);
- m_animation_card->rect().move_by(m_x_velocity, 0);
+ m_animation_card->rect().translate_by(m_x_velocity, 0);
} else {
- m_animation_card->rect().move_by(m_x_velocity, m_y_velocity);
+ m_animation_card->rect().translate_by(m_x_velocity, m_y_velocity);
}
}