aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-03 13:23:35 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-03 13:23:35 +0000
commit1d12b1fd66e5be27fb4769ee09ce4fcd6bcc5979 (patch)
treeca0087f12bbd5e7e8094352d2f79b2e91f0d3955 /include/core
parent55b6b58d8f6e7529c9b9cea606a6e3637c8e2e39 (diff)
add setXYWH to rects
new tests for circles git-svn-id: http://skia.googlecode.com/svn/trunk@877 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkRect.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index b6caad5cd6..114d1f990c 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -95,6 +95,13 @@ struct SkIRect {
fBottom = bottom;
}
+ void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height) {
+ fLeft = x;
+ fTop = y;
+ fRight = x + width;
+ fBottom = y + height;
+ }
+
/** Offset set the rectangle by adding dx to its left and right,
and adding dy to its top and bottom.
*/
@@ -348,6 +355,13 @@ struct SkRect {
*/
void set(const SkPoint pts[], int count);
+ void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height) {
+ fLeft = x;
+ fTop = y;
+ fRight = x + width;
+ fBottom = y + height;
+ }
+
/** Offset set the rectangle by adding dx to its left and right,
and adding dy to its top and bottom.
*/