add roundOut()
git-svn-id: http://skia.googlecode.com/svn/trunk@2019 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
1b20280f9b
commit
099d22dbce
@ -566,6 +566,18 @@ struct SK_API SkRect {
|
||||
SkScalarCeil(fRight), SkScalarCeil(fBottom));
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand this rectangle by rounding its coordinates "out", choosing the
|
||||
* floor of top and left, and the ceil of right and bottom. If this rect
|
||||
* is already on integer coordinates, then it will be unchanged.
|
||||
*/
|
||||
void roundOut() {
|
||||
this->set(SkScalarFloorToScalar(fLeft),
|
||||
SkScalarFloorToScalar(fTop),
|
||||
SkScalarCeilToScalar(fRight),
|
||||
SkScalarCeilToScalar(fBottom));
|
||||
}
|
||||
|
||||
/**
|
||||
* Swap top/bottom or left/right if there are flipped (i.e. if width()
|
||||
* or height() would have returned a negative value.) This should be called
|
||||
|
Loading…
Reference in New Issue
Block a user