twice materialChanged signal fixed

This commit is contained in:
2023-05-23 22:22:25 +03:00
parent 893910c431
commit fcc1e98a6e
8 changed files with 29 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ MaterialEditor::MaterialEditor(QWidget * parent): QWidget(parent) {
ui->label_13->hide();
mat = 0;
active = true;
ignore_next = 0;
ignore_next = false;
}
@@ -51,7 +51,7 @@ void MaterialEditor::changeEvent(QEvent * e) {
void MaterialEditor::materialChanged() {
if (!active || !mat) return;
ignore_next = 2;
ignore_next = true;
mat->_changed = true;
mat->color_diffuse = ui->mapDiffuse->color();
mat->color_emission = ui->mapEmission->color();
@@ -65,8 +65,8 @@ void MaterialEditor::materialChanged() {
void MaterialEditor::setMaterial(Material * m) {
if (ignore_next > 0) {
// ignore_next = false;
if (ignore_next) {
ignore_next = false;
return;
}
active = false;