From 0952d594f8f62d04880d7c0d743e6aab3c77e59b Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:18:26 +0100 Subject: [PATCH] Fix fl_draw_image sometimes crashes when window is scaled - cont'd (#1134) --- src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 1 + src/fl_draw_pixmap.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 87d4d4f328..932ef7d820 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -107,6 +107,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } void Fl_Quartz_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){ + d &= ~FL_IMAGE_WITH_ALPHA; innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0,gc_,this); } void Fl_Quartz_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data, diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index d2d8816e20..7670680ce1 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -217,7 +217,7 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { } // for Y } - fl_draw_image(buffer, x, y, w, h, 4); + fl_draw_image(buffer, x, y, w, h, 4 | FL_IMAGE_WITH_ALPHA); delete[] buffer; return 1;