From 008d71f5b7c121335bc2de620cf7cddfaa0f8d70 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:55:59 +0200 Subject: [PATCH] Fix for artefact in X11 1-pixel thick rect drawing with some drivers (#156, #1052) --- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx index 689f0eccf..25cb6a285 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx @@ -228,7 +228,10 @@ void Fl_Xlib_Graphics_Driver::focus_rect(int x, int y, int w, int h) { } void Fl_Xlib_Graphics_Driver::rect_unscaled(int x, int y, int w, int h) { + void *old = NULL; + if (line_width_ == 0) old = change_pen_width(1); // #156, #1052 XDrawRectangle(fl_display, fl_window, gc_, x, y, w, h); + if (old) reset_pen_width(old); } void Fl_Xlib_Graphics_Driver::rectf_unscaled(int x, int y, int w, int h) {