From d66748a5dae4941b5917c3d10764aa481309095d Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 19 Jul 2024 16:33:57 -0400 Subject: [PATCH] fix invalid texture draw by returning if bitmap is inactive --- src/app/gui/canvas.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/gui/canvas.cc b/src/app/gui/canvas.cc index d691a941..df346ef3 100644 --- a/src/app/gui/canvas.cc +++ b/src/app/gui/canvas.cc @@ -416,6 +416,9 @@ void Canvas::DrawBitmap(const Bitmap &bitmap, int border_offset, bool ready) { } void Canvas::DrawBitmap(const Bitmap &bitmap, int border_offset, float scale) { + if (!bitmap.is_active()) { + return; + } draw_list_->AddImage((void *)bitmap.texture(), ImVec2(canvas_p0_.x, canvas_p0_.y), ImVec2(canvas_p0_.x + (bitmap.width() * scale), @@ -425,6 +428,9 @@ void Canvas::DrawBitmap(const Bitmap &bitmap, int border_offset, float scale) { void Canvas::DrawBitmap(const Bitmap &bitmap, int x_offset, int y_offset, float scale, int alpha) { + if (!bitmap.is_active()) { + return; + } draw_list_->AddImage( (void *)bitmap.texture(), ImVec2(canvas_p0_.x + x_offset + scrolling_.x,