Fix BitMap.resize error spam

Fixes #70187.

(cherry picked from commit ddd7189b39)
This commit is contained in:
Paweł Fertyk 2022-12-20 21:54:21 +01:00 committed by Rémi Verschelde
parent 0ed57602d9
commit 62f2b8a940
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -606,8 +606,8 @@ void BitMap::resize(const Size2 &p_new_size) {
Ref<BitMap> new_bitmap;
new_bitmap.instance();
new_bitmap->create(p_new_size);
int lw = MIN(width, p_new_size.width);
int lh = MIN(height, p_new_size.height);
int lw = MIN(width, new_bitmap->width);
int lh = MIN(height, new_bitmap->height);
for (int x = 0; x < lw; x++) {
for (int y = 0; y < lh; y++) {
new_bitmap->set_bit(Vector2(x, y), get_bit(Vector2(x, y)));