Skip to content

Commit

Permalink
Pass value as reference in Gradient class
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Aug 9, 2023
1 parent bc367e3 commit d4e569e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/object/gradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/object/gradient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit d4e569e

Please sign in to comment.