Browse Source

Corrected the fill bugs in the GDI binding

Benedikt Müssig 3 năm trước cách đây
mục cha
commit
dca0f6fcfc
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      demo/gdi/nuklear_gdi.h

+ 5 - 2
demo/gdi/nuklear_gdi.h

@@ -421,8 +421,10 @@ nk_gdi_stroke_arc(HDC dc, short cx, short cy, unsigned short r, float amin, floa
         end_x = cx + (int) ((float)r*nk_cos(amin)),
         end_y = cy + (int) ((float)r*nk_sin(amin));
 
+    HGDIOBJ br = SelectObject(dc, GetStockObject(NULL_BRUSH));
     SetArcDirection(dc, AD_COUNTERCLOCKWISE);
     Pie(dc, cx-r, cy-r, cx+r, cy+r, start_x, start_y, end_x, end_y);
+    SelectObject(dc, br);
 
     if (pen)
     {
@@ -468,10 +470,11 @@ nk_gdi_stroke_circle(HDC dc, short x, short y, unsigned short w,
         pen = CreatePen(PS_SOLID, line_thickness, color);
         SelectObject(dc, pen);
     }
-
-    SelectObject(dc, GetStockObject(NULL_BRUSH));
+    
+    HGDIOBJ br = SelectObject(dc, GetStockObject(NULL_BRUSH));
     SetDCBrushColor(dc, OPAQUE);
     Ellipse(dc, x, y, x + w, y + h);
+    SelectObject(dc, br);
 
     if (pen) {
         SelectObject(dc, GetStockObject(DC_PEN));