From 9e90d41b58d6eafbf90a7435ea40c8c94e0aa1b1 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 3 May 2014 13:30:18 +1000 Subject: Using casts and an alternate PRectangle constructor to make XYPOSITION <-> int conversions and other conversions more consistent. --- include/Platform.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/Platform.h') diff --git a/include/Platform.h b/include/Platform.h index 138eb8a75..5f8c2f2a1 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -126,6 +126,10 @@ public: PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } + PRectangle(int left_, int top_, int right_, int bottom_) : + left(static_cast(left_)), top(static_cast(top_)), + right(static_cast(right_)), bottom(static_cast(bottom_)) { + } // Other automatically defined methods (assignment, copy constructor, destructor) are fine -- cgit v1.2.3