xref: /MusicPlayer2/scintilla/src/IntegerRectangle.h (revision 443d2d2511be730d1b1dd3181942b7fa6539aa1a)
1 // Scintilla source code edit control
2 /** @file IntegerRectangle.h
3  ** A rectangle with integer coordinates.
4  **/
5 // Copyright 2018 by Neil Hodgson <[email protected]>
6 // The License.txt file describes the conditions under which this software may be distributed.
7 
8 #ifndef INTEGERRECTANGLE_H
9 #define INTEGERRECTANGLE_H
10 
11 namespace Scintilla {
12 
13 struct IntegerRectangle {
14 	int left;
15 	int top;
16 	int right;
17 	int bottom;
18 
19 	explicit IntegerRectangle(PRectangle rc) noexcept :
20 		left(static_cast<int>(rc.left)), top(static_cast<int>(rc.top)),
21 		right(static_cast<int>(rc.right)), bottom(static_cast<int>(rc.bottom)) {
22 	}
23 	int Width() const noexcept { return right - left; }
24 	int Height() const noexcept { return bottom - top; }
25 };
26 
27 }
28 
29 #endif
30