diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-04 16:20:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:20:48 +0100 |
commit | 8e13b93bf78e4440e2012cec4940b8e3318daac1 (patch) | |
tree | 9517c56d9b9e0bacbf1c1955a31f6472ee573e55 /doc/classes/Geometry2D.xml | |
parent | 89f605c717e271050a6cc61547ea3d25996a19c4 (diff) | |
parent | 424cd00f8b14aa51aad82c52996740d7648ae691 (diff) |
Merge pull request #43310 from akien-mga/doc-classref-sync
doc: Sync classref with current source
Diffstat (limited to 'doc/classes/Geometry2D.xml')
-rw-r--r-- | doc/classes/Geometry2D.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index 86dc8e864a..a6bcc1301b 100644 --- a/doc/classes/Geometry2D.xml +++ b/doc/classes/Geometry2D.xml @@ -200,11 +200,11 @@ Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType]. The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - [b]Note:[/b] To translate the polygon's vertices specifically, use the [method Transform2D.xform] method: + [b]Note:[/b] To translate the polygon's vertices specifically, multiply them to a [Transform2D]: [codeblock] var polygon = PackedVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) var offset = Vector2(50, 50) - polygon = Transform2D(0, offset).xform(polygon) + polygon = Transform2D(0, offset) * polygon print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)] [/codeblock] </description> |