FIX: button deflate border on MacOS

Change-Id: I5993ff5f56662758a5ffb9d5316bc1b4bce7f25b
This commit is contained in:
chunmao.guo 2022-08-01 19:38:46 +08:00 committed by Lane.Wei
parent 56e05a0721
commit 5f4f859337

View file

@ -148,7 +148,7 @@ void StaticBox::doRender(wxDC& dc)
if (background_color2.count() == 0) {
if ((border_width && border_color.count() > 0) || background_color.count() > 0) {
wxRect rc(0, 0, size.x, size.y);
if (border_width && border_color.count() > 0) {
if (border_width && border_color.count() > 0 && (GetWindowStyle() & wxBORDER_NONE) == 0) {
#ifdef __WXOSX__
int d = ceil(border_width / 2.0);
rc.Deflate(d, d);
@ -158,8 +158,6 @@ void StaticBox::doRender(wxDC& dc)
dc.SetPen(wxPen(background_color.colorForStates(states)));
}
dc.SetBrush(wxBrush(background_color.colorForStates(states)));
if (GetWindowStyle() & wxBORDER_NONE)
dc.SetPen(wxPen(background_color.colorForStates(states)));
if (radius == 0) {
dc.DrawRectangle(rc);
}