aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-02-20 14:33:13 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-20 19:56:23 +0000
commitedfe6703fae3becc53feed27c4fa09a95ea7e19d (patch)
tree377c639078e6adc3a36ca4b86a3f365f4235ce48 /site
parent0c3137c4f45ffbf09a41526e5eb96e12cc6f35ae (diff)
fix Rect doc
move the #Line directive to make bookmaker happy Docs-Preview: https://skia.org/?cl=108740 Bug: skia:6898 Change-Id: I8b993bab6b4f69cc266941e281a00a945f32f25e Reviewed-on: https://skia-review.googlesource.com/108740 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site')
-rw-r--r--site/user/api/SkIRect_Reference.md12
-rw-r--r--site/user/api/SkRect_Reference.md66
-rw-r--r--site/user/api/catalog.htm13
3 files changed, 70 insertions, 21 deletions
diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md
index a8c52b625f..ee4cb41820 100644
--- a/site/user/api/SkIRect_Reference.md
+++ b/site/user/api/SkIRect_Reference.md
@@ -1611,7 +1611,7 @@ rect: (30, 50, 40, 60) does not contain (30, 60)
### See Also
-<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
@@ -1660,7 +1660,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
### See Also
-<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
@@ -1702,7 +1702,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
### See Also
-<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
@@ -1744,7 +1744,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
### See Also
-<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
@@ -1796,7 +1796,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
### See Also
-<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
@@ -1838,7 +1838,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
### See Also
-<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup>
+<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup>
---
diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md
index d643f9dc7b..815e4c0575 100644
--- a/site/user/api/SkRect_Reference.md
+++ b/site/user/api/SkRect_Reference.md
@@ -1943,7 +1943,7 @@ describes an area: <a href="#SkRect_fLeft">fLeft</a> is less than <a href="#SkRe
| --- | --- |
| <a href="#SkRect_Intersects">Intersects</a> | returns true if areas overlap |
| <a href="#SkRect_contains">contains</a> | returns true if points are equal or inside |
-| | <a href="#SkRect_contains">contains(const SkRect& r)</a> const |
+| | <a href="#SkRect_contains">contains(SkScalar x, SkScalar y)</a> const |
| <a href="#SkRect_intersect">intersect</a> | sets to shared area; returns true if not empty |
| | <a href="#SkRect_intersect">intersect(const SkRect& r)</a> |
| <a href="#SkRect_intersects">intersects</a> | returns true if areas overlap |
@@ -1953,24 +1953,66 @@ describes an area: <a href="#SkRect_fLeft">fLeft</a> is less than <a href="#SkRe
## contains
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
+bool contains(SkScalar x, SkScalar y) const
+</pre>
+
+Returns true if: <a href="#SkRect_fLeft">fLeft</a> <= x < <a href="#SkRect_fRight">fRight</a> && <a href="#SkRect_fTop">fTop</a> <= y < <a href="#SkRect_fBottom">fBottom</a>.
+Returns false if <a href="#SkRect">SkRect</a> is empty.
+
+### Parameters
+
+<table> <tr> <td><a name="SkRect_contains_x"> <code><strong>x </strong></code> </a></td> <td>
+test <a href="SkPoint_Reference#SkPoint">SkPoint</a> x-coordinate</td>
+ </tr> <tr> <td><a name="SkRect_contains_y"> <code><strong>y </strong></code> </a></td> <td>
+test <a href="SkPoint_Reference#SkPoint">SkPoint</a> y-coordinate</td>
+ </tr>
+</table>
+
+### Return Value
+
+true if (x, y) is inside <a href="#SkRect">SkRect</a>
+
+### Example
+
+<div><fiddle-embed name="85be528a78945a6dc4f7dccb80a80746">
+
+#### Example Output
+
+~~~~
+rect: (30, 50, 40, 60) contains (30, 50)
+rect: (30, 50, 40, 60) does not contain (39, 49)
+rect: (30, 50, 40, 60) does not contain (29, 59)
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="SkIRect_Reference#SkIRect_contains">SkIRect::contains</a><sup><a href="SkIRect_Reference#SkIRect_contains_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_3">[3]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_4">[4]</a></sup>
+
+---
+
+<a name="SkRect_contains_2"></a>
+
+<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
bool contains(const SkRect& r) const
</pre>
-Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_r">r</a>.
-Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_r">r</a> is empty.
+Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a>.
+Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_2_r">r</a> is empty.
-<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_r">r</a> area.
+<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_2_r">r</a> area.
### Parameters
-<table> <tr> <td><a name="SkRect_contains_r"> <code><strong>r </strong></code> </a></td> <td>
+<table> <tr> <td><a name="SkRect_contains_2_r"> <code><strong>r </strong></code> </a></td> <td>
<a href="#Rect">Rect</a> contained</td>
</tr>
</table>
### Return Value
-true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_r">r</a>
+true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_2_r">r</a>
### Example
@@ -1992,27 +2034,27 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
---
-<a name="SkRect_contains_2"></a>
+<a name="SkRect_contains_3"></a>
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
bool contains(const SkIRect& r) const
</pre>
-Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a>.
-Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_2_r">r</a> is empty.
+Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_3_r">r</a>.
+Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_3_r">r</a> is empty.
-<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_2_r">r</a> area.
+<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_3_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_3_r">r</a> area.
### Parameters
-<table> <tr> <td><a name="SkRect_contains_2_r"> <code><strong>r </strong></code> </a></td> <td>
+<table> <tr> <td><a name="SkRect_contains_3_r"> <code><strong>r </strong></code> </a></td> <td>
<a href="SkIRect_Reference#IRect">IRect</a> contained</td>
</tr>
</table>
### Return Value
-true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_2_r">r</a>
+true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_3_r">r</a>
### Example
diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm
index 3c57a28919..4f1a9f27b8 100644
--- a/site/user/api/catalog.htm
+++ b/site/user/api/catalog.htm
@@ -2703,17 +2703,24 @@
"stdout": "left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38\\n"
},
"SkRect_contains": {
+ "code": "void draw(SkCanvas* canvas) {\n SkRect rect = { 30, 50, 40, 60 };\n SkPoint tests[] = { { 30, 50 }, { 39, 49 }, { 29, 59 } };\n for (auto contained : tests) {\n SkDebugf(\"rect: (%g, %g, %g, %g) %s (%g, %g)\\n\",\n rect.left(), rect.top(), rect.right(), rect.bottom(),\n rect.contains(contained.x(), contained.y()) ? \"contains\" : \"does not contain\",\n contained.x(), contained.y());\n }\n}",
+ "hash": "85be528a78945a6dc4f7dccb80a80746",
+ "file": "SkRect_Reference",
+ "name": "SkRect::contains()",
+ "stdout": "rect: (30, 50, 40, 60) contains (30, 50)\\nrect: (30, 50, 40, 60) does not contain (39, 49)\\nrect: (30, 50, 40, 60) does not contain (29, 59)\\n"
+ },
+ "SkRect_contains_2": {
"code": "void draw(SkCanvas* canvas) {\n SkRect rect = { 30, 50, 40, 60 };\n SkRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };\n for (auto contained : tests) {\n SkDebugf(\"rect: (%g, %g, %g, %g) %s (%g, %g, %g, %g)\\n\",\n rect.left(), rect.top(), rect.right(), rect.bottom(),\n rect.contains(contained) ? \"contains\" : \"does not contain\",\n contained.left(), contained.top(), contained.right(), contained.bottom());\n }\n}",
"hash": "92f9e6aa5bb76791139a24cf7d8df99e",
"file": "SkRect_Reference",
- "name": "SkRect::contains()",
+ "name": "SkRect::contains_2",
"stdout": "rect: (30, 50, 40, 60) contains (30, 50, 31, 51)\\nrect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)\\nrect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)\\n"
},
- "SkRect_contains_2": {
+ "SkRect_contains_3": {
"code": "void draw(SkCanvas* canvas) {\n SkRect rect = { 30, 50, 40, 60 };\n SkIRect tests[] = { { 30, 50, 31, 51}, { 39, 49, 40, 50}, { 29, 59, 30, 60} };\n for (auto contained : tests) {\n SkDebugf(\"rect: (%g, %g, %g, %g) %s (%d, %d, %d, %d)\\n\",\n rect.left(), rect.top(), rect.right(), rect.bottom(),\n rect.contains(contained) ? \"contains\" : \"does not contain\",\n contained.left(), contained.top(), contained.right(), contained.bottom());\n }\n}",
"hash": "dd58b699551dd44026a2c6386be27d88",
"file": "SkRect_Reference",
- "name": "SkRect::contains_2",
+ "name": "SkRect::contains_3",
"stdout": "rect: (30, 50, 40, 60) contains (30, 50, 31, 51)\\nrect: (30, 50, 40, 60) does not contain (39, 49, 40, 50)\\nrect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)\\n"
},
"SkRect_dump": {