aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/Platform.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-03-18 19:22:38 +1100
committerNeil <nyamatongwe@gmail.com>2019-03-18 19:22:38 +1100
commit7e4bd49b1315de495ad37ed7d19897abdcf44b94 (patch)
tree8737893d8ce56a276bd673d4d236ed2ab66f3b9a /include/Platform.h
parent0bc5b663b3166f562053413ce9381ad481e68a99 (diff)
downloadscintilla-mirror-7e4bd49b1315de495ad37ed7d19897abdcf44b94.tar.gz
Backport: Add some operators to Point to simplify client code.
Backport of changeset 7321:d488340e94c0.
Diffstat (limited to 'include/Platform.h')
-rw-r--r--include/Platform.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/Platform.h b/include/Platform.h
index 654460901..8f5417fe0 100644
--- a/include/Platform.h
+++ b/include/Platform.h
@@ -108,6 +108,18 @@ public:
return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_));
}
+ bool operator!=(Point other) const noexcept {
+ return (x != other.x) || (y != other.y);
+ }
+
+ Point operator+(Point other) const noexcept {
+ return Point(x + other.x, y + other.y);
+ }
+
+ Point operator-(Point other) const noexcept {
+ return Point(x - other.x, y - other.y);
+ }
+
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
};