Fix drawing narrow toolbar buttons were missing mid-sections

(cherry picked from commit bd19b7e8fe68affae4445021764e1348201bbb9a)
This commit is contained in:
Dmitry Makarenko
2025-01-21 15:01:02 +03:00
committed by Avery King
parent afceb9d672
commit 81e8a10600

View File

@@ -130,16 +130,25 @@ namespace
dc.StretchBlit(x0, y2, xw0, yh2, &memDC, u0, v2, uw0, vh2, wxCOPY, true);
dc.StretchBlit(x2, y2, xw2, yh2, &memDC, u2, v2, uw2, vh2, wxCOPY, true);
if(xw1 > 0 && yh1 > 0)//Draw middle
//Draw top/bottom sides mid section
if(xw1 > 0)
{
dc.StretchBlit(x1, y0, xw1, yh0, &memDC, u1, v0, uw1, vh0, wxCOPY, true);
dc.StretchBlit(x0, y1, xw0, yh1, &memDC, u0, v1, uw0, vh1, wxCOPY, true);
dc.StretchBlit(x1, y1, xw1, yh1, &memDC, u1, v1, uw1, vh1, wxCOPY, true);
dc.StretchBlit(x2, y1, xw2, yh1, &memDC, u2, v1, uw2, vh1, wxCOPY, true);
dc.StretchBlit(x1, y2, xw1, yh2, &memDC, u1, v2, uw1, vh2, wxCOPY, true);
}
//Draw left/right sides mid section
if(yh1 > 0)
{
dc.StretchBlit(x0, y1, xw0, yh1, &memDC, u0, v1, uw0, vh1, wxCOPY, true);
dc.StretchBlit(x2, y1, xw2, yh1, &memDC, u2, v1, uw2, vh1, wxCOPY, true);
}
//Draw center
if(xw1 > 0 && yh1 > 0)
{
dc.StretchBlit(x1, y1, xw1, yh1, &memDC, u1, v1, uw1, vh1, wxCOPY, true);
}
}
int GetButtonImageIndex(bool up, bool selected, bool highlight)