FLTK logo

[master] bf47091 - Fix X11 platform bug when drawing transparent RGB image without XRender.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] bf47091 - Fix X11 platform bug when drawing transparent RGB image without XRender. "ManoloFLTK" Nov 25, 2021  
 
commit bf470919f7ce9eff87789192e3643d13f3404a03
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Thu Nov 25 09:12:08 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Thu Nov 25 09:12:08 2021 +0100

    Fix X11 platform bug when drawing transparent RGB image without XRender.
    
    The bug would appear with test/device and when scaling up to 133% or above:
    the background of the Porsche pixmap would be truncated.
    The bug requires to set OPTION_XRENDERER=0 to appear.

 src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 3b431e7..216f582 100644
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -746,6 +746,7 @@ void Fl_Xlib_Graphics_Driver::draw_fixed(Fl_RGB_Image *img, int X, int Y, int W,
     return;
   }
   // Composite image with alpha manually each time...
+  push_no_clip();
   float s = scale();
   Fl_Graphics_Driver::scale(1);
   int ox = offset_x_, oy = offset_y_;
@@ -754,12 +755,11 @@ void Fl_Xlib_Graphics_Driver::draw_fixed(Fl_RGB_Image *img, int X, int Y, int W,
   int nscreen = Fl_Window_Driver::driver(Fl_Window::current())->screen_num();
   float keep = d->scale(nscreen);
   d->scale(nscreen, 1);
-  push_no_clip();
   alpha_blend(img, X, Y, W, H, cx, cy);
-  pop_clip();
   d->scale(nscreen, keep);
   Fl_Graphics_Driver::scale(s);
   offset_x_ = ox; offset_y_ = oy;
+  pop_clip();
 }
 
 #if HAVE_XRENDER
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.