From 38cad05357690d2b4eb63e4749d60d0e1d0130a0 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:36:27 +0100 Subject: [PATCH] Improve Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) --- src/Fl_Image.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 80c34f7c1..ab258a1b0 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -891,13 +891,10 @@ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) { // fl_max(cx, 0),fl_max(cy, 0) = top-left of drawn part in image. int l = (ld() ? ld() : d() * w()); const uchar *p = array + fl_max(cy, 0) * l + fl_max(cx, 0) * d(); - if (d() % 2) { // use draw_image() without transparenvy - fl_graphics_driver->draw_image(p, r1.x, r1.y, r1.width, r1.height, d(), l); - } else { // with transparency, build temporary RGB image and draw it - Fl_RGB_Image *temp_rgb = new Fl_RGB_Image(p, r1.width, r1.height, d(), l); - fl_graphics_driver->draw_rgb(temp_rgb, r1.x, r1.y, r1.width, r1.height, 0, 0); - delete temp_rgb; - } + // build temporary RGB image and draw it + Fl_RGB_Image *temp_rgb = new Fl_RGB_Image(p, r1.width, r1.height, d(), l); + fl_graphics_driver->draw_rgb(temp_rgb, r1.x, r1.y, r1.width, r1.height, 0, 0); + delete temp_rgb; } else fl_graphics_driver->draw_rgb(this, XP, YP, WP, HP, cx, cy); }