Changeset 1284


Ignore:
Timestamp:
12/06/23 03:25:43 (13 months ago)
Author:
Maciej Komosinski
Message:

Added the != operator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/2d.h

    r1274 r1284  
    3939        T distanceTo(const XY &p) const { return sqrt(distanceToSq(p)); }
    4040        T distanceToSq(const XY &p) const { return double((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y)); }
    41         T magnitude() const { return sqrt(x * x + y * y); }
    4241        T length() const { return sqrt(x * x + y * y); }
    4342        T lengthSq() const { return x * x + y * y; }
     
    9089        XYRect toInt() const { return XYRect(int(p.x), int(p.y), int(p.x + size.x) - int(p.x), int(p.y + size.y) - int(p.y)); }
    9190        bool operator==(const XYRect &r) const { return (p == r.p) && (size == r.size); }
     91        bool operator!=(const XYRect &r) const { return !operator==(r); }
    9292        template <typename Q> const XYRect &operator=(const Q &other) { p = other.p; size = other.size; return *this; }
    9393
Note: See TracChangeset for help on using the changeset viewer.