X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fposition.h;h=3c561d85c2b14b909b2f7e1fd2445bed662ff189;hb=769c71b5c3e050ccfc1c13771d24328fbf76a495;hp=f9bd0987cdb5ed3e2688ed63bf0d5cfdbbf1597d;hpb=98060a4e6f02b418f30b4b736e5880a357454c40;p=dcpomatic.git diff --git a/src/lib/position.h b/src/lib/position.h index f9bd0987c..3c561d85c 100644 --- a/src/lib/position.h +++ b/src/lib/position.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ #define DCPOMATIC_POSITION_H /** @struct Position - * @brief A position. + * @brief A position (x and y coordinates) */ template class Position @@ -50,4 +50,25 @@ operator+ (Position const & a, Position const & b) return Position (a.x + b.x, a.y + b.y); } +template +Position +operator- (Position const & a, Position const & b) +{ + return Position (a.x - b.x, a.y - b.y); +} + +template +bool +operator== (Position const & a, Position const & b) +{ + return a.x == b.x && a.y == b.y; +} + +template +bool +operator!= (Position const & a, Position const & b) +{ + return a.x != b.x || a.y != b.y; +} + #endif