From 5acdfc9e34f2f509d19c5020aeb9d410af2a95f6 Mon Sep 17 00:00:00 2001 From: Martins Mozeiko Date: Mon, 29 Jan 2018 22:07:54 -0800 Subject: [PATCH] correctly draw non-filled rectangle for GDI demo --- demo/gdi/nuklear_gdi.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/demo/gdi/nuklear_gdi.h b/demo/gdi/nuklear_gdi.h index 932a70a..9020958 100644 --- a/demo/gdi/nuklear_gdi.h +++ b/demo/gdi/nuklear_gdi.h @@ -170,6 +170,13 @@ nk_gdi_stroke_rect(HDC dc, short x, short y, unsigned short w, unsigned short h, unsigned short r, unsigned short line_thickness, struct nk_color col) { COLORREF color = convert_color(col); + POINT points[] = { + { x, y }, + { x + w, y }, + { x + w, y + h }, + { x, y + h }, + { x, y }, + }; HPEN pen = NULL; if (line_thickness == 1) { @@ -179,12 +186,7 @@ nk_gdi_stroke_rect(HDC dc, short x, short y, unsigned short w, SelectObject(dc, pen); } - SetDCBrushColor(dc, OPAQUE); - if (r == 0) { - Rectangle(dc, x, y, x + w, y + h); - } else { - RoundRect(dc, x, y, x + w, y + h, r, r); - } + Polyline(dc, points, 5); if (pen) { SelectObject(dc, GetStockObject(DC_PEN));