Fixed bugged color pickers caused by incorrect conversion from CColor to QColor

This commit is contained in:
parax0 2015-12-26 00:42:34 -07:00
parent 72f87665d4
commit efb21f629a
2 changed files with 6 additions and 6 deletions

View File

@ -234,10 +234,10 @@ void CModelEditorWindow::SetActiveMaterial(int MatIndex)
{ {
QColor Color; QColor Color;
CColor KColor = mpCurrentMat->Konst(iKonst); CColor KColor = mpCurrentMat->Konst(iKonst);
Color.setRed(KColor.r); Color.setRed(KColor.r * 255);
Color.setGreen(KColor.g); Color.setGreen(KColor.g * 255);
Color.setBlue(KColor.b); Color.setBlue(KColor.b * 255);
Color.setAlpha(KColor.a); Color.setAlpha(KColor.a * 255);
if (iKonst == 0) ui->KonstColorPickerA->setColor(Color); if (iKonst == 0) ui->KonstColorPickerA->setColor(Color);
else if (iKonst == 1) ui->KonstColorPickerB->setColor(Color); else if (iKonst == 1) ui->KonstColorPickerB->setColor(Color);

View File

@ -244,7 +244,7 @@ void WPropertyEditor::CreateEditor()
WColorPicker *pColorPicker = new WColorPicker(this); WColorPicker *pColorPicker = new WColorPicker(this);
CColor color = pColorCast->Get(); CColor color = pColorCast->Get();
QColor qcolor = QColor(color.r, color.g, color.b, color.a); QColor qcolor = QColor(color.r * 255, color.g * 255, color.b * 255, color.a * 255);
pColorPicker->setColor(qcolor); pColorPicker->setColor(qcolor);
mUI.EditorWidget = pColorPicker; mUI.EditorWidget = pColorPicker;
@ -424,7 +424,7 @@ void WPropertyEditor::UpdateEditor()
WColorPicker *pColorPicker = static_cast<WColorPicker*>(mUI.EditorWidget); WColorPicker *pColorPicker = static_cast<WColorPicker*>(mUI.EditorWidget);
CColor color = pColorCast->Get(); CColor color = pColorCast->Get();
QColor qcolor = QColor(color.r, color.g, color.b, color.a); QColor qcolor = QColor(color.r * 255, color.g * 255, color.b * 255, color.a * 255);
pColorPicker->setColor(qcolor); pColorPicker->setColor(qcolor);
break; break;