Merge pull request #91446 from HexagonNico/rect-doc-fix
Fix incorrect example in the documentation for the `expand` method in `Rect2`
This commit is contained in:
commit
a0b0b19043
|
@ -89,13 +89,13 @@
|
||||||
var rect = Rect2(0, 0, 5, 2)
|
var rect = Rect2(0, 0, 5, 2)
|
||||||
|
|
||||||
rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2)
|
rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2)
|
||||||
rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 10, 5)
|
rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 15, 5)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var rect = new Rect2(0, 0, 5, 2);
|
var rect = new Rect2(0, 0, 5, 2);
|
||||||
|
|
||||||
rect = rect.Expand(new Vector2(10, 0)); // rect is Rect2(0, 0, 10, 2)
|
rect = rect.Expand(new Vector2(10, 0)); // rect is Rect2(0, 0, 10, 2)
|
||||||
rect = rect.Expand(new Vector2(-5, 5)); // rect is Rect2(-5, 0, 10, 5)
|
rect = rect.Expand(new Vector2(-5, 5)); // rect is Rect2(-5, 0, 15, 5)
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/codeblocks]
|
||||||
</description>
|
</description>
|
||||||
|
|
|
@ -88,13 +88,13 @@
|
||||||
var rect = Rect2i(0, 0, 5, 2)
|
var rect = Rect2i(0, 0, 5, 2)
|
||||||
|
|
||||||
rect = rect.expand(Vector2i(10, 0)) # rect is Rect2i(0, 0, 10, 2)
|
rect = rect.expand(Vector2i(10, 0)) # rect is Rect2i(0, 0, 10, 2)
|
||||||
rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 10, 5)
|
rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 15, 5)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
var rect = new Rect2I(0, 0, 5, 2);
|
var rect = new Rect2I(0, 0, 5, 2);
|
||||||
|
|
||||||
rect = rect.Expand(new Vector2I(10, 0)); // rect is Rect2I(0, 0, 10, 2)
|
rect = rect.Expand(new Vector2I(10, 0)); // rect is Rect2I(0, 0, 10, 2)
|
||||||
rect = rect.Expand(new Vector2I(-5, 5)); // rect is Rect2I(-5, 0, 10, 5)
|
rect = rect.Expand(new Vector2I(-5, 5)); // rect is Rect2I(-5, 0, 15, 5)
|
||||||
[/csharp]
|
[/csharp]
|
||||||
[/codeblocks]
|
[/codeblocks]
|
||||||
</description>
|
</description>
|
||||||
|
|
Loading…
Reference in New Issue