FIX:fix bug for the base color of the color modification

after matching the untreated material
jira:STUDIO-10062

Change-Id: I699fd843600182bc87b224eee488e752b64ca0b4
(cherry picked from commit 29b0be89eb5190bd83d783bf173f14950aef738d)
This commit is contained in:
zhou.xu
2025-01-22 09:08:10 +08:00
committed by Noisyfox
parent 1b7f64ccd3
commit 34eac964aa
12 changed files with 164 additions and 19 deletions

View File

@@ -34,7 +34,8 @@ const int LEFT_OFFSET = 2;
{
m_arraw_bitmap_gray = ScalableBitmap(this, "drop_down2", FromDIP(8));
m_arraw_bitmap_white = ScalableBitmap(this, "topbar_dropdown", 12);
m_transparent_mitem = ScalableBitmap(this, "transparent_material_item", FromDIP(50));
m_transparent_mitem = ScalableBitmap(this, "transparent_material_up", FromDIP(16));
m_filament_wheel_transparent = ScalableBitmap(this, "filament_transparent", FromDIP(20));//wxGetApp().dark_mode() ? "filament_dark_transparent"
//m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel", FromDIP(25));
m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel_narrow", 25);
m_ams_not_match = ScalableBitmap(this, "filament_not_mactch", 25);
@@ -206,7 +207,7 @@ void MaterialItem::doRender(wxDC& dc)
auto acolor = m_ams_coloul;
change_the_opacity(acolor);
if (mcolor.Alpha() == 0 || acolor.Alpha() == 0) {
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1));
}
@@ -315,7 +316,11 @@ void MaterialItem::doRender(wxDC& dc)
wheel_left += m_ams_wheel_mitem.GetBmpSize().x;
dc.DrawBitmap(m_ams_not_match.bmp(), (size.x - m_ams_not_match.GetBmpWidth()) / 2 - FromDIP(LEFT_OFFSET), wheel_top);
} else {
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_filament_wheel_transparent.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} else {
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
}
}
}
@@ -406,8 +411,8 @@ void MaterialSyncItem::doRender(wxDC &dc)
auto acolor = m_ams_coloul;
change_the_opacity(acolor);
if (mcolor.Alpha() == 0 || acolor.Alpha() == 0) {
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1));
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(0), FromDIP(0));
}
if (!IsEnabled()) {
@@ -503,7 +508,11 @@ void MaterialSyncItem::doRender(wxDC &dc)
auto wheel_left = (GetSize().x / 2 - m_ams_wheel_mitem.GetBmpSize().x) / 2 + FromDIP(2);
auto wheel_top = ((float) GetSize().y * 0.6 - m_ams_wheel_mitem.GetBmpSize().y) / 2 + (float) GetSize().y * 0.4;
if (m_match) {// different with parent
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_filament_wheel_transparent.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} else {
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
}
}
//not draw m_ams_not_match
}