summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-08-27 16:52:20 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-08-27 16:52:20 +0200
commit5fae7b36bb98b99a7b5b84e42c702945ff073983 (patch)
tree06ac0ea853d8153087cef93d15f07d427a4b61d7 /src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
parentec05f78d98d8e38ea34eb1bd73647fa5b8b35f81 (diff)
Fix Fl_GDI_Graphics_Driver::rect_unscaled() (#1052)
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
index 1e70b7929..a86242e12 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
@@ -62,21 +62,17 @@ 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) {
- 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);
+ if (is_solid_ && line_width_ > 1) {
+ line_style_unscaled(FL_CAP_SQUARE, line_width_, 0); // see issue #1052
}
MoveToEx(gc_, x, y, 0L);
LineTo(gc_, x+w, y);
- if (line_width_ <= 1) LineTo(gc_, x+w, y+h+1); // see issue #1052
+ if (is_solid_ && 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);
+ if (is_solid_ && line_width_ > 1) {
+ line_style_unscaled(style_, line_width_, 0);
}
}