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