Browse Source

Use `Vector2i` when returning atlas size in `Geometry2D::make_atlas`

Marc Gilleron 3 years ago
parent
commit
700bb066e0
2 changed files with 2 additions and 3 deletions
  1. 1 2
      core/core_bind.cpp
  2. 1 1
      doc/classes/Geometry2D.xml

+ 1 - 2
core/core_bind.cpp

@@ -810,14 +810,13 @@ Dictionary Geometry2D::make_atlas(const Vector<Size2> &p_rects) {
 
 	::Geometry2D::make_atlas(rects, result, size);
 
-	Size2 r_size = size;
 	Vector<Point2> r_result;
 	for (int i = 0; i < result.size(); i++) {
 		r_result.push_back(result[i]);
 	}
 
 	ret["points"] = r_result;
-	ret["size"] = r_size;
+	ret["size"] = size;
 
 	return ret;
 }

+ 1 - 1
doc/classes/Geometry2D.xml

@@ -126,7 +126,7 @@
 			<return type="Dictionary" />
 			<param index="0" name="sizes" type="PackedVector2Array" />
 			<description>
-				Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is an array of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2].
+				Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is a [PackedVector2Array] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2i].
 			</description>
 		</method>
 		<method name="merge_polygons">