1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #pragma once19 20 21 22 23 #if defined(WIN32) && defined(MATH_WIN32_INTEROP)24 #include "../Math/InclWindows.h"25 #endif26 27 [MATH_BEGIN_NAMESPACE]28 29 30 class [Rect]31 {32 public:33 [Rect]() { [left] = [top] = [right] = [bottom] = 0; }34 [Rect](int left_, int top_, int width, int height)35 :[left](left_), [top](top_), [right]([left] + width), [bottom]([top] + height) {}36 37 38 int [Width]() { return [right] - [left]; }39 int [Height]() { return [bottom] - [top]; }40 41 int [left];42 int [top];43 int [right];44 int [bottom];45 46 #if defined(WIN32) && defined(MATH_WIN32_INTEROP)47 operator RECT()48 {49 RECT r;50 r.top = [top];51 r.left = [left];52 r.right = [right];53 r.bottom = [bottom];54 return r;55 }56 [Rect](const RECT &r)57 {58 [top] = r.top;59 [left] = r.left;60 [bottom] = r.bottom;61 [right] = r.right;62 }63 #endif64 };65 66 [MATH_END_NAMESPACE] Go back to previous page