Skip to content

Commit

Permalink
libdeng2|Rectangle: Another fromSize() constructor
Browse files Browse the repository at this point in the history
Constructing a rectangle from just the Size vector.
  • Loading branch information
skyjake committed Apr 26, 2013
1 parent 510e089 commit c380fee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doomsday/libdeng2/include/de/rectangle.h
Expand Up @@ -49,6 +49,9 @@ class Rectangle
Rectangle(Type left, Type top, SizeType width, SizeType height)
: topLeft(left, top), bottomRight(left + width, top + height) {}
Rectangle(Corner const &tl, Corner const &br) : topLeft(tl), bottomRight(br) {}
static RectangleType fromSize(Size const &size) {
return RectangleType(0, 0, size.x, size.y);
}
static RectangleType fromSize(Corner const &tl, Size const &size) {
return RectangleType(tl.x, tl.y, size.x, size.y);
}
Expand Down

0 comments on commit c380fee

Please sign in to comment.