Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/joystick/include/joystick.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Joystick : public BaseComponent {
* @brief Get the most recently updated calibrated position.
* @return The most recent position (from when update() was last called).
*/
espp::Vector2f position() const;
const espp::Vector2f &position() const;

/**
* @brief Get the most recently updated raw / uncalibrated readings. This
Expand All @@ -213,7 +213,7 @@ class Joystick : public BaseComponent {
* @return The most recent raw measurements (from when update() was last
* called).
*/
espp::Vector2f raw() const;
const espp::Vector2f &raw() const;

friend struct fmt::formatter<Joystick>;

Expand Down
4 changes: 2 additions & 2 deletions components/joystick/src/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ float espp::Joystick::x() const { return position_.x(); }

float espp::Joystick::y() const { return position_.y(); }

espp::Vector2f espp::Joystick::position() const { return position_; }
const espp::Vector2f &espp::Joystick::position() const { return position_; }

espp::Vector2f espp::Joystick::raw() const { return raw_; }
const espp::Vector2f &espp::Joystick::raw() const { return raw_; }

void espp::Joystick::recalculate(float raw_x, float raw_y) {
raw_.x(raw_x);
Expand Down
2 changes: 1 addition & 1 deletion components/math/include/vector2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ template <typename T> class Vector2d {
* @brief Getter for the x value.
* @return The current x value.
*/
T x() const { return x_; }
const T &x() const { return x_; }

/**
* @brief Setter for the x value.
Expand Down