4.0 fix atlas texture return null
This commit is contained in:
parent
7cdd8629ad
commit
2cc2adedaa
2 changed files with 10 additions and 0 deletions
|
@ -1272,6 +1272,14 @@ bool AtlasTexture::is_pixel_opaque(int p_x, int p_y) const {
|
|||
return atlas->is_pixel_opaque(x, y);
|
||||
}
|
||||
|
||||
Ref<Image> AtlasTexture::get_image() const {
|
||||
if (!atlas.is_valid()) {
|
||||
return Ref<Image>();
|
||||
}
|
||||
|
||||
return atlas->get_image()->get_rect(region);
|
||||
}
|
||||
|
||||
AtlasTexture::AtlasTexture() {}
|
||||
|
||||
/////////////////////////////////////////
|
||||
|
|
|
@ -252,6 +252,8 @@ public:
|
|||
|
||||
bool is_pixel_opaque(int p_x, int p_y) const override;
|
||||
|
||||
virtual Ref<Image> get_image() const override;
|
||||
|
||||
AtlasTexture();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue