mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-02 06:17:03 +01:00
Fix crash when calling fill
method on an empty Image
(cherry picked from commit adec51cde87d29dd74efb6e5cd0167990de8d569)
This commit is contained in:
parent
575adb91fc
commit
9a1705eac2
@ -2483,6 +2483,10 @@ void Image::_repeat_pixel_over_subsequent_memory(uint8_t *p_pixel, int p_pixel_s
|
||||
}
|
||||
|
||||
void Image::fill(const Color &p_color) {
|
||||
if (data.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot fill in compressed or custom image formats.");
|
||||
|
||||
lock();
|
||||
@ -2501,6 +2505,10 @@ void Image::fill(const Color &p_color) {
|
||||
}
|
||||
|
||||
void Image::fill_rect(const Rect2 &p_rect, const Color &p_color) {
|
||||
if (data.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND_MSG(!_can_modify(format), "Cannot fill rect in compressed or custom image formats.");
|
||||
|
||||
Rect2i r = Rect2i(0, 0, width, height).clip(p_rect.abs());
|
||||
|
Loading…
Reference in New Issue
Block a user