diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-07-28 17:57:31 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-07-28 17:57:39 +0200 |
| commit | 41a6ade72bd12b7f354d314ec59fac29ae783afb (patch) | |
| tree | 9a30aef7578520b4d1ebe2ea03c5b294a479620a /src | |
| parent | b40e218c01497b529dea7f35a734e28e4f26049d (diff) | |
Fix for issue #119. Drawing artefacts for SVG images without XRender.
Xlib: Drawing SVG images in scaled mode without XRender has drawing artefacts.
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index b379a8e88..b20a84cfe 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -640,6 +640,11 @@ void Fl_Xlib_Graphics_Driver::draw_fixed(Fl_Bitmap *bm, int X, int Y, int W, int // Composite an image with alpha on systems that don't have accelerated // alpha compositing... static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) { + if (cx < 0) { W += cx; X -= cx; cx = 0; } + if (cy < 0) { H += cy; Y -= cy; cy = 0; } + if (W + cx > img->data_w()) W = img->data_w() - cx; + if (H + cy > img->data_h()) H = img->data_h() - cy; + if (W <= 0 || H <= 0) return; int ld = img->ld(); if (ld == 0) ld = img->data_w() * img->d(); uchar *srcptr = (uchar*)img->array + cy * ld + cx * img->d(); |
