mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-27 00:24:00 -06:00
FIX:fixed gradient filament color display on MacOS
Change-Id: I57f3243f5013b8d26ace3fae2cc41e807494af6b
This commit is contained in:
parent
975aa70651
commit
ef6827a6f8
5 changed files with 24 additions and 12 deletions
|
@ -887,9 +887,7 @@ void AMSLib::doRender(wxDC &dc)
|
|||
int top = height - curr_height;
|
||||
|
||||
if (curr_height >= FromDIP(6)) {
|
||||
#ifdef __APPLE__
|
||||
dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius);
|
||||
#else
|
||||
|
||||
//gradient
|
||||
if (m_info.material_cols.size() > 1) {
|
||||
int left = FromDIP(4);
|
||||
|
@ -898,22 +896,22 @@ void AMSLib::doRender(wxDC &dc)
|
|||
|
||||
for (int i = 0; i < m_info.material_cols.size() - 1; i++) {
|
||||
|
||||
if ( (left + gwidth) > (size.x - FromDIP(8)) ) {
|
||||
if ((left + gwidth) > (size.x - FromDIP(8))) {
|
||||
gwidth = (size.x - FromDIP(4)) - left;
|
||||
}
|
||||
|
||||
auto rect = wxRect(left, height - curr_height + FromDIP(4), gwidth, curr_height);
|
||||
dc.GradientFillLinear(rect, m_info.material_cols[i], m_info.material_cols[i+1], wxEAST);
|
||||
dc.GradientFillLinear(rect, m_info.material_cols[i], m_info.material_cols[i + 1], wxEAST);
|
||||
left += gwidth;
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef __APPLE__
|
||||
dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius);
|
||||
#else
|
||||
dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius - 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (top > 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue