浏览代码

Make Image.get_size() return a Vector2i instead of a Vector2

Samuele Zolfanelli 3 年之前
父节点
当前提交
e27c5acedd
共有 3 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      core/io/image.cpp
  2. 1 1
      core/io/image.h
  3. 1 1
      doc/classes/Image.xml

+ 2 - 2
core/io/image.cpp

@@ -416,8 +416,8 @@ int Image::get_height() const {
 	return height;
 }
 
-Vector2 Image::get_size() const {
-	return Vector2(width, height);
+Vector2i Image::get_size() const {
+	return Vector2i(width, height);
 }
 
 bool Image::has_mipmaps() const {

+ 1 - 1
core/io/image.h

@@ -209,7 +209,7 @@ private:
 public:
 	int get_width() const; ///< Get image width
 	int get_height() const; ///< Get image height
-	Vector2 get_size() const;
+	Vector2i get_size() const;
 	bool has_mipmaps() const;
 	int get_mipmap_count() const;
 

+ 1 - 1
doc/classes/Image.xml

@@ -250,7 +250,7 @@
 			</description>
 		</method>
 		<method name="get_size" qualifiers="const">
-			<return type="Vector2" />
+			<return type="Vector2i" />
 			<description>
 				Returns the image's size (width and height).
 			</description>