From d4e569e87bbd1b3a477028793946cccf8889b0ac Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Wed, 9 Aug 2023 03:02:42 +0200 Subject: [PATCH] Pass value as reference in Gradient class --- src/object/gradient.cpp | 4 ++-- src/object/gradient.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/object/gradient.cpp b/src/object/gradient.cpp index c6f53f70855..911905a3c04 100644 --- a/src/object/gradient.cpp +++ b/src/object/gradient.cpp @@ -197,7 +197,7 @@ Gradient::update(float delta) } void -Gradient::set_gradient(Color top, Color bottom) +Gradient::set_gradient(const Color& top, const Color& bottom) { m_gradient_top = top; m_gradient_bottom = bottom; @@ -220,7 +220,7 @@ Gradient::set_gradient(Color top, Color bottom) } void -Gradient::fade_gradient(Color top, Color bottom, float time) +Gradient::fade_gradient(const Color& top, const Color& bottom, float time) { m_start_gradient_top = m_gradient_top; m_start_gradient_bottom = m_gradient_bottom; diff --git a/src/object/gradient.hpp b/src/object/gradient.hpp index 99b4f720602..6539a6d5cf0 100644 --- a/src/object/gradient.hpp +++ b/src/object/gradient.hpp @@ -51,8 +51,8 @@ class Gradient final : virtual void on_flip(float height) override; - void set_gradient(Color top, Color bottom); - void fade_gradient(Color top, Color bottom, float time); + void set_gradient(const Color& top, const Color& bottom); + void fade_gradient(const Color& top, const Color& bottom, float time); Color get_gradient_top() const { return m_gradient_top; } Color get_gradient_bottom() const { return m_gradient_bottom; }