Preventing display glitch from invalid scaling of view

This commit is contained in:
brunoherbelin
2021-03-27 23:31:18 +01:00
parent 6687bdd258
commit 8a75664264
3 changed files with 14 additions and 0 deletions

View File

@@ -144,6 +144,11 @@ void GeometryView::update(float dt)
}
output_surface_->setTextureIndex( output->texture() );
}
// prevent invalid scaling
float s = CLAMP(scene.root()->scale_.x, GEOMETRY_MIN_SCALE, GEOMETRY_MAX_SCALE);
scene.root()->scale_.x = s;
scene.root()->scale_.y = s;
}
// the current view is the geometry view

View File

@@ -169,6 +169,11 @@ void LayerView::update(float dt)
persp_left_->translation_.x = -aspect_ratio;
persp_right_->translation_.x = aspect_ratio + 0.06;
}
// prevent invalid scaling
float s = CLAMP(scene.root()->scale_.x, LAYER_MIN_SCALE, LAYER_MAX_SCALE);
scene.root()->scale_.x = s;
scene.root()->scale_.y = s;
}
if (Mixer::manager().view() == this )

View File

@@ -280,6 +280,10 @@ void MixingView::update(float dt)
f = 1.f - f;
mixingCircle_->shader()->color = glm::vec4(f, f, f, 1.f);
// prevent invalid scaling
float s = CLAMP(scene.root()->scale_.x, MIXING_MIN_SCALE, MIXING_MAX_SCALE);
scene.root()->scale_.x = s;
scene.root()->scale_.y = s;
}
// the current view is the mixing view