FIX: switch_diameter in sync

Change-Id: Iff7c654ef932f36b9c3cb4267e4ea90b8074c9c2
Jira: STUDIO-9744
(cherry picked from commit 0c01d7b3e0224f745b249e8d8dbe1990f3b407bc)
This commit is contained in:
chunmao.guo
2025-01-16 16:12:21 +08:00
committed by Noisyfox
parent d1de8c47d7
commit 66eb27cfaa
2 changed files with 12 additions and 5 deletions

View File

@@ -61,10 +61,11 @@ void StaticGroup::PaintForeground(wxDC &dc, const struct tagRECT &rc)
int right = rc.right - 1;
int bottom = rc.bottom - 1;
auto blue = GetBackgroundColour().Blue();
while (image.GetBlue(0, top) == blue) ++top;
while (image.GetBlue(left, top) != blue) ++left; // --left; // fix start
while (image.GetBlue(right, top) != blue) --right; ++right;
while (image.GetBlue(0, bottom) == blue) --bottom;
while (image.GetBlue(0, top) == blue && top < bottom) ++top;
while (image.GetBlue(left, top) != blue && left < right) ++left; // --left; // fix start
while (image.GetBlue(right, top) != blue && right > 0) --right;
++right;
while (image.GetBlue(0, bottom) == blue && bottom > 0) --bottom;
// Draw border with foreground color
wxPoint polygon[] = { {left, top}, {0, top}, {0, bottom}, {rc.right - 1, bottom}, {rc.right - 1, top}, {right, top} };
dc.SetPen(wxPen(borderColor_, 1));