From c5bb5def461e0be763510f2818e8162cd92cf583 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 30 Nov 2024 15:13:57 +0100 Subject: [PATCH] Gui: Do not ignore alpha channel when converting QImage to SoSFImage Fixes #18213: Sketcher constraints have black box backgrounds --- src/Gui/BitmapFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index 73056f6825..1fd92ab83e 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -588,7 +588,7 @@ void BitmapFactoryInst::convert(const QImage& p, SoSFImage& img) const } break; case 2: { - QRgb rgb = col.rgb(); + QRgb rgb = col.rgba(); line[0] = qGray(rgb); line[1] = qAlpha(rgb); } break; @@ -601,7 +601,7 @@ void BitmapFactoryInst::convert(const QImage& p, SoSFImage& img) const } break; case 4: { - QRgb rgb = col.rgb(); + QRgb rgb = col.rgba(); line[0] = qRed(rgb); line[1] = qGreen(rgb); line[2] = qBlue(rgb);