Changeset View
Changeset View
Standalone View
Standalone View
misc/rect.cc
Show All 12 Lines | |||||
13 | // You should have received a copy of the GNU General Public License | 13 | // You should have received a copy of the GNU General Public License | ||
14 | // along with this program; if not, write to the Free Software | 14 | // along with this program; if not, write to the Free Software | ||
15 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 15 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
16 | // 02110-1301, USA. | 16 | // 02110-1301, USA. | ||
17 | 17 | | |||
18 | #include "rect.h" | 18 | #include "rect.h" | ||
19 | #include "common.h" | 19 | #include "common.h" | ||
20 | 20 | | |||
21 | Rect& Rect::operator=( const Rect& other ) | ||||
22 | { | ||||
23 | if (this != &other) | ||||
24 | { | ||||
25 | setBottomLeft( other.bottomLeft() ); | ||||
26 | setWidth( other.width() ); | ||||
27 | setHeight( other.height() ); | ||||
28 | } | ||||
29 | normalize(); | ||||
30 | return *this; | ||||
31 | } | ||||
32 | | ||||
21 | bool operator==( const Rect& r, const Rect& s ) | 33 | bool operator==( const Rect& r, const Rect& s ) | ||
22 | { | 34 | { | ||
23 | return ( r.bottomLeft() == s.bottomLeft() | 35 | return ( r.bottomLeft() == s.bottomLeft() | ||
24 | && r.width() == s.width() | 36 | && r.width() == s.width() | ||
25 | && r.height() == s.height() ); | 37 | && r.height() == s.height() ); | ||
26 | } | 38 | } | ||
27 | 39 | | |||
28 | QDebug& operator<<( QDebug& s, const Rect& t ) | 40 | QDebug& operator<<( QDebug& s, const Rect& t ) | ||
▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines |