diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-08-26 09:22:04 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-08-26 09:22:04 +0200 |
| commit | 6d04ef2caa1d78ffb388b5ef13f7df0ebbaf9f39 (patch) | |
| tree | 840365b300fa2f80984d5c239d0e4c3669479c22 /src | |
| parent | 01f687e26aa784cc96f9cfcd3c9a5f6ce6e52500 (diff) | |
Fix Fl_GDI_Graphics_Driver::rect_unscaled() (#1052)
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx index 4527ee920..1e70b7929 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx @@ -62,11 +62,22 @@ void Fl_GDI_Graphics_Driver::focus_rect(int x, int y, int w, int h) { } void Fl_GDI_Graphics_Driver::rect_unscaled(int x, int y, int w, int h) { - MoveToEx(fl_gc, x, y, 0L); - LineTo(fl_gc, x+w, y); - LineTo(fl_gc, x+w, y+h); - LineTo(fl_gc, x, y+h); - LineTo(fl_gc, x, y); + HPEN oldpen, newpen; + if (line_width_ > 1) { + LOGBRUSH penbrush = {BS_SOLID, fl_RGB(), 0}; + newpen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_SQUARE, line_width_, &penbrush, 0, 0); + oldpen = (HPEN)SelectObject(gc_, newpen); + } + MoveToEx(gc_, x, y, 0L); + LineTo(gc_, x+w, y); + if (line_width_ <= 1) LineTo(gc_, x+w, y+h+1); // see issue #1052 + LineTo(gc_, x+w, y+h); + LineTo(gc_, x, y+h); + LineTo(gc_, x, y); + if (line_width_ > 1) { + SelectObject(gc_, oldpen); + DeleteObject(newpen); + } } void Fl_GDI_Graphics_Driver::rectf_unscaled(int x, int y, int w, int h) { |
