[nostalgia/geo] Fix Point + and * operators to return the computed result
This commit is contained in:
parent
b502b8cc30
commit
4dd1d4331b
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user