respect transparency when setting color per face

This commit is contained in:
wmayer
2019-01-05 19:50:12 +01:00
parent f875775fdb
commit 6145aee5a1

View File

@@ -332,9 +332,10 @@ void FaceColors::on_defaultButton_clicked()
void FaceColors::on_colorButton_changed()
{
if (!d->index.isEmpty()) {
float alpha = static_cast<float>(d->vp->Transparency.getValue())/100;
QColor c = d->ui->colorButton->color();
for (QSet<int>::iterator it = d->index.begin(); it != d->index.end(); ++it) {
d->perface[*it].set(c.redF(), c.greenF(), c.blueF());
d->perface[*it].set(c.redF(), c.greenF(), c.blueF(), alpha);
}
d->vp->DiffuseColor.setValues(d->perface);
}