summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisterMX <mbxd12@web.de>2022-09-28 17:03:50 +0200
committerMisterMX <mbxd12@web.de>2022-09-28 17:04:15 +0200
commit407bbdda20c6b45f05f8eebd27262e0b6c950a5c (patch)
tree0e473858b022da318358ffe7d92efddbca61ded2
parent7f113042c01e4ad59a8cd747bcc1a47058fa2a43 (diff)
refactor(TileMap): Return Rect2i in get_used_rect
Signed-off-by: MisterMX <mbxd12@web.de>
-rw-r--r--doc/classes/TileMap.xml2
-rw-r--r--scene/2d/tile_map.cpp2
-rw-r--r--scene/2d/tile_map.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index 54eb83297d..fd9c44091c 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -188,7 +188,7 @@
</description>
</method>
<method name="get_used_rect">
- <return type="Rect2" />
+ <return type="Rect2i" />
<description>
Returns a rectangle enclosing the used (non-empty) tiles of the map, including all layers.
</description>
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 577284a752..bdcd1f2f28 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -3615,7 +3615,7 @@ TypedArray<Vector2i> TileMap::get_used_cells(int p_layer) const {
return a;
}
-Rect2 TileMap::get_used_rect() { // Not const because of cache
+Rect2i TileMap::get_used_rect() { // Not const because of cache
// Return the rect of the currently used area
if (used_rect_cache_dirty) {
bool first = true;
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index b1a2118c6b..902926291d 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -375,7 +375,7 @@ public:
Vector2i get_neighbor_cell(const Vector2i &p_coords, TileSet::CellNeighbor p_cell_neighbor) const;
TypedArray<Vector2i> get_used_cells(int p_layer) const;
- Rect2 get_used_rect(); // Not const because of cache
+ Rect2i get_used_rect(); // Not const because of cache
// Override some methods of the CanvasItem class to pass the changes to the quadrants CanvasItems
virtual void set_light_mask(int p_light_mask) override;