8 #include "vstguibase.h" 20 CPoint (CCoord x, CCoord y) : x (x), y (y) {}
21 CPoint& operator () (CCoord _x, CCoord _y) { x = _x; y = _y;
return *
this; }
23 bool operator!= (
const CPoint &other)
const {
return (x != other.x || y != other.y); }
24 bool operator== (
const CPoint &other)
const {
return (x == other.x && y == other.y); }
26 CPoint& operator+= (
const CPoint& other) { x += other.x; y += other.y;
return *
this; }
27 CPoint& operator-= (
const CPoint& other) { x -= other.x; y -= other.y;
return *
this; }
28 CPoint operator+ (
const CPoint& other)
const {
return CPoint (x + other.x, y + other.y); }
29 CPoint operator- (
const CPoint& other)
const {
return CPoint (x - other.x, y - other.y); }
32 CPoint& offset (
const CCoord c) { *
this +=
CPoint (c, c);
return *
this; }
33 CPoint& offset (
const CCoord _x,
const CCoord _y) { *
this +=
CPoint (_x, _y);
return *
this; }
34 CPoint& offset (
const CPoint& other) { *
this += other;
return *
this; }
35 CPoint& offsetInverse (
const CPoint& other) { *
this -= other;
return *
this; }
37 inline CPoint& makeIntegral ();
44 inline CPoint& CPoint::makeIntegral ()
46 x = std::floor (x + 0.5);
47 y = std::floor (y + 0.5);
Definition: customcontrols.cpp:8
Point structure.
Definition: cpoint.h:17