mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
prevent zero dimensions for Volume3DOverlay
This commit is contained in:
parent
2e92d40c8d
commit
b602c18475
1 changed files with 13 additions and 1 deletions
|
@ -45,7 +45,19 @@ void Volume3DOverlay::setProperties(const QVariantMap& properties) {
|
|||
}
|
||||
|
||||
if (dimensions.isValid()) {
|
||||
setDimensions(vec3FromVariant(dimensions));
|
||||
glm::vec3 scale = vec3FromVariant(dimensions);
|
||||
// don't allow a zero or negative dimension component to reach the renderTransform
|
||||
const float MIN_DIMENSION = 0.0001f;
|
||||
if (scale.x < MIN_DIMENSION) {
|
||||
scale.x = MIN_DIMENSION;
|
||||
}
|
||||
if (scale.y < MIN_DIMENSION) {
|
||||
scale.y = MIN_DIMENSION;
|
||||
}
|
||||
if (scale.z < MIN_DIMENSION) {
|
||||
scale.z = MIN_DIMENSION;
|
||||
}
|
||||
setDimensions(scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue