aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-05-18 10:19:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-18 14:53:45 +0000
commit8f8d481b44fc486e7190c6e2db8077226d53c969 (patch)
tree9b95ff9d8d2a801f7daf15c74b796d4c18660a28 /docs
parentdd8b1fc41bb8b09974836a30ec357f8f20ad7cae (diff)
Add SkIRect::adjust method
Change-Id: Ib18d1a82944524e20d5d72912d8db7a823c470de Reviewed-on: https://skia-review.googlesource.com/128884 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkIRect_Reference.bmh35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index 4fcb26a48c..23905754af 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -1041,6 +1041,41 @@ describes an area: fLeft is less than fRight, and fTop is less than fBottom.
# ------------------------------------------------------------------------------
+#Method void adjust(int32_t dL, int32_t dT, int32_t dR, int32_t dB)
+
+#In Inset_Outset_Offset
+#Line # moves the sides independently relative to their original locations ##
+Adjusts IRect by adding dL to fLeft, dT to fTop, dR to fRight, and fB to fBottom.
+
+If dL is positive, narrows IRect on the left. If negative, widens it on the left.
+If dT is positive, shrinks IRect on the top. If negative, lengthens it on the top.
+If dR is positive, narrows IRect on the right. If negative, widens it on the right.
+If dB is positive, shrinks IRect on the bottom. If negative, lengthens it on the bottom.
+
+The resulting IRect is not checked for validity. Thus, if the resulting IRect left is
+greater than right, the IRect will be considered empty. Call sort() after this call
+if that is not the desired behavior.
+
+#Param dL offset added to fLeft ##
+#Param dT offset added to fTop ##
+#Param dR offset added to fRight ##
+#Param dB offset added to fBottom ##
+
+#Example
+ SkIRect rect = { 8, 11, 19, 22 };
+ rect.adjust(2, -1, 1, -2);
+ SkDebugf("rect: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
+#StdOut
+rect: 10, 10, 20, 20
+##
+##
+
+#SeeAlso inset outset
+
+##
+
+# ------------------------------------------------------------------------------
+
#Method bool contains(int32_t x, int32_t y) const
#In Intersection