Skip to content

Commit f9e623e

Browse files
krice-nwpeterflynn
authored andcommitted
Document new Polygon startRatio property. Updated Polygon example.
1 parent 79cdf9c commit f9e623e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

reference/scenegraph.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,10 @@ Like all shape nodes, has no size, fill, or stroke by default unless you set one
12761276
```js
12771277
// Add a red triangle to the document and select it
12781278
var polygon = new Polygon();
1279-
polygon.cornerCount = 3;
1280-
polygon.width = 50;
1279+
polygon.cornerCount = 5;
1280+
polygon.starRatio = 55;
1281+
polygon.setAllCornerRadii(15);
1282+
polygon.width = 100;
12811283
polygon.height = 100;
12821284
polygon.fill = new Color("red");
12831285
selection.insertionParent.addChild(polygon);
@@ -1291,6 +1293,7 @@ selection.items = [polygon];
12911293
* [.cornerRadii](#Polygon-cornerRadii) : <code>!Array&lt;number&gt;</code>
12921294
* [.hasRoundedCorners](#Polygon-hasRoundedCorners) : <code>boolean</code>
12931295
* [.setAllCornerRadii(radius)](#Polygon-setAllCornerRadii)
1296+
* [.starRatio](#Polygon-starRatio) : <code>number</code>
12941297

12951298

12961299
* * *
@@ -1363,6 +1366,24 @@ Set the corner radius of all corners of the Polygon to the same value.
13631366

13641367
* * *
13651368

1369+
<a name="Polygon-starRatio"></a>
1370+
1371+
### polygon.starRatio : <code>number</code> (number >= 1 && <= 100)
1372+
The star ratio percentage.
1373+
1374+
Ratio, expressed as a percentage, used to determine how much of a star is this polygon,
1375+
with values ranging between 1 and 100 percent.
1376+
A value of 100 percent gives us a star that looks like a convex polygon, while a value of
1377+
1 percent should give us something similar to lines drawn from the center.
1378+
1379+
The star inner vertices are placed on a circle. The ratio is the percentage of that circle
1380+
from the inscribed circle of the polygon formed from the star outer vertices.
1381+
1382+
**Kind**: instance property of [<code>Polygon</code>](#Polygon)
1383+
**Since**: XD 26
1384+
1385+
* * *
1386+
13661387

13671388
<a name="Line"></a>
13681389

0 commit comments

Comments
 (0)