update Rect docs - right/bottom information

This commit is contained in:
Vadim Lopatin 2017-06-14 08:50:53 +03:00
parent 8bcfb8dcdd
commit 6f4a9636a0
1 changed files with 5 additions and 3 deletions

View File

@ -62,15 +62,17 @@ struct Point {
}
}
/// 2D rectangle
/** 2D rectangle
Note: Rect(0,0,20,10) size is 20x10 -- right and bottom sides are non-inclusive -- if you draw such rect, rightmost drawn pixel will be x=19 and bottom pixel y=9
*/
struct Rect {
/// x coordinate of top left corner
int left;
/// y coordinate of top left corner
int top;
/// x coordinate of bottom right corner
/// x coordinate of bottom right corner (non-inclusive)
int right;
/// y coordinate of bottom right corner
/// y coordinate of bottom right corner (non-inclusive)
int bottom;
/// returns average of left, right
@property int middlex() { return (left + right) / 2; }