From 4dd1d4331b3ed767af742104ba684e8b99cd92e7 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 10 Mar 2022 19:40:56 -0600 Subject: [PATCH] [nostalgia/geo] Fix Point + and * operators to return the computed result --- src/nostalgia/geo/point.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nostalgia/geo/point.hpp b/src/nostalgia/geo/point.hpp index 8b2b64a0..2ef2c25b 100644 --- a/src/nostalgia/geo/point.hpp +++ b/src/nostalgia/geo/point.hpp @@ -69,9 +69,9 @@ constexpr Point::Point(int x, int y) noexcept { constexpr Point Point::operator+(const geo::Point &p) const noexcept { auto out = *this; - out.x += x; - out.y += y; - return p; + out.x += p.x; + out.y += p.y; + return out; } constexpr Point Point::operator-(const geo::Point &p) const noexcept { @@ -83,9 +83,9 @@ constexpr Point Point::operator-(const geo::Point &p) const noexcept { constexpr Point Point::operator*(const geo::Point &p) const noexcept { auto out = *this; - out.x *= x; - out.y *= y; - return p; + out.x *= p.x; + out.y *= p.y; + return out; } constexpr Point Point::operator/(const geo::Point &p) const noexcept {