diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-05 20:05:56 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-05 20:05:56 +0000 |
commit | f81401763e2faed6f3af0552ae904edda1864684 (patch) | |
tree | a7fe77f695cbaff05a1d95498a357860d7a7545d /gpu/include | |
parent | 3eb291455ca4d6fec64967981c73de0bb8c4860b (diff) |
add rect.inset(dx, dy)
git-svn-id: http://skia.googlecode.com/svn/trunk@1058 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include')
-rw-r--r-- | gpu/include/GrRect.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gpu/include/GrRect.h b/gpu/include/GrRect.h index 552fa5e58c..67e366c3bf 100644 --- a/gpu/include/GrRect.h +++ b/gpu/include/GrRect.h @@ -233,6 +233,15 @@ struct GrRect { } /** + * 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. */ |