summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-09-18 02:19:55 +0200
committerMicky <micheledevita2@gmail.com>2022-11-01 23:35:48 +0100
commitebf86c96e9b648ce1f7d654032e21d4aa84b8985 (patch)
tree273fb5c2aad13abdce6571ec4a886448164a0cc4 /core/io
parente6751549cf7247965d1744b8c464f5e901006f21 (diff)
Rename Image's `get_rect` to `get_region`
Also renames its parameter to from "rect" to "region".
Diffstat (limited to 'core/io')
-rw-r--r--core/io/image.cpp8
-rw-r--r--core/io/image.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 16dd66fc98..bb715a8cb3 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -2636,9 +2636,9 @@ Rect2i Image::get_used_rect() const {
}
}
-Ref<Image> Image::get_rect(const Rect2i &p_area) const {
- Ref<Image> img = memnew(Image(p_area.size.x, p_area.size.y, mipmaps, format));
- img->blit_rect(Ref<Image>((Image *)this), p_area, Point2i(0, 0));
+Ref<Image> Image::get_region(const Rect2i &p_region) const {
+ Ref<Image> img = memnew(Image(p_region.size.x, p_region.size.y, mipmaps, format));
+ img->blit_rect(Ref<Image>((Image *)this), p_region, Point2i(0, 0));
return img;
}
@@ -3362,7 +3362,7 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("fill_rect", "rect", "color"), &Image::fill_rect);
ClassDB::bind_method(D_METHOD("get_used_rect"), &Image::get_used_rect);
- ClassDB::bind_method(D_METHOD("get_rect", "rect"), &Image::get_rect);
+ ClassDB::bind_method(D_METHOD("get_region", "region"), &Image::get_region);
ClassDB::bind_method(D_METHOD("copy_from", "src"), &Image::copy_internals_from);
diff --git a/core/io/image.h b/core/io/image.h
index 194ee05bc7..62df81e7c8 100644
--- a/core/io/image.h
+++ b/core/io/image.h
@@ -377,7 +377,7 @@ public:
void fill_rect(const Rect2i &p_rect, const Color &p_color);
Rect2i get_used_rect() const;
- Ref<Image> get_rect(const Rect2i &p_area) const;
+ Ref<Image> get_region(const Rect2i &p_area) const;
static void set_compress_bc_func(void (*p_compress_func)(Image *, float, UsedChannels));
static void set_compress_bptc_func(void (*p_compress_func)(Image *, float, UsedChannels));