add rect.inset(dx, dy)

git-svn-id: http://skia.googlecode.com/svn/trunk@1058 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-04-05 20:05:56 +00:00
parent 3eb291455c
commit f81401763e

View File

@ -232,6 +232,15 @@ struct GrRect {
fRight += tx; fBottom += ty;
}
/**
* Inset the rectangle by dx,dy. If dx > 0 the rect becomes narrower,
* if dx < 0 the rect becomes wider.
*/
void inset(GrScalar dx, GrScalar dy) {
fLeft += dx; fTop += dy;
fRight -= dx; fBottom -= dy;
}
/**
* Initialize a rectangle to a point.
* @param pt the point used to initialize the rectangle.