Fix for one-frame glitch when changing dimensions of a model entity.

This was due to Model::setScaleToFit being called on the script thread instead of the main thread.
This commit is contained in:
Anthony J. Thibault 2016-07-06 14:09:55 -07:00
parent 122902714a
commit a07970f053

View file

@ -100,7 +100,9 @@ void ModelOverlay::setProperties(const QVariantMap& properties) {
if (newScale.x <= 0 || newScale.y <= 0 || newScale.z <= 0) {
setDimensions(scale);
} else {
_model->setScaleToFit(true, getDimensions());
QMetaObject::invokeMethod(_model.get(), "setScaleToFit", Qt::AutoConnection,
Q_ARG(const bool&, true),
Q_ARG(const glm::vec3&, getDimensions()));
_updateModel = true;
}
}