Bitmap: Fix getPixel calls not using cached surface

This commit is contained in:
Amaryllis Kulla 2022-01-30 12:22:06 +01:00
parent e156421b3b
commit d71919c2c3
1 changed files with 2 additions and 1 deletions

View File

@ -914,7 +914,8 @@ Color Bitmap::getPixel(int x, int y) const
if (x < 0 || y < 0 || x >= width() || y >= height()) if (x < 0 || y < 0 || x >= width() || y >= height())
return Vec4(); return Vec4();
p->downloadToSurface(); if (!p->surface)
p->downloadToSurface();
uint32_t pixel = getPixelAt(p->surface, p->format, x, y); uint32_t pixel = getPixelAt(p->surface, p->format, x, y);