From d71919c2c3876416ee486b374bb4558255e6130f Mon Sep 17 00:00:00 2001 From: Amaryllis Kulla Date: Sun, 30 Jan 2022 12:22:06 +0100 Subject: [PATCH] Bitmap: Fix getPixel calls not using cached surface --- src/bitmap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bitmap.cpp b/src/bitmap.cpp index cec61bb..a8d2aab 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -914,7 +914,8 @@ Color Bitmap::getPixel(int x, int y) const if (x < 0 || y < 0 || x >= width() || y >= height()) return Vec4(); - p->downloadToSurface(); + if (!p->surface) + p->downloadToSurface(); uint32_t pixel = getPixelAt(p->surface, p->format, x, y);