瀏覽代碼

Merge pull request #9231 from dumitru-stama/constimg

Fixed a bug in get_pixel not being const
George Marques 8 年之前
父節點
當前提交
b1537da605
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      core/image.cpp
  2. 1 1
      core/image.h

+ 1 - 1
core/image.cpp

@@ -1712,7 +1712,7 @@ void Image::unlock() {
 	write_lock = PoolVector<uint8_t>::Write();
 }
 
-Color Image::get_pixel(int p_x, int p_y) {
+Color Image::get_pixel(int p_x, int p_y) const {
 
 	uint8_t *ptr = write_lock.ptr();
 #ifdef DEBUG_ENABLED

+ 1 - 1
core/image.h

@@ -310,7 +310,7 @@ public:
 
 	DetectChannels get_detected_channels();
 
-	Color get_pixel(int p_x, int p_y);
+	Color get_pixel(int p_x, int p_y) const;
 	void put_pixel(int p_x, int p_y, const Color &p_color);
 
 	void copy_internals_from(const Ref<Image> &p_image) {