viewer: fixed occasional OCIO bug

Addresses a flaw where if the user changed the OCIO "display", Olive wouldn't
check whether the currently selected "view" still existed in the new display
or not which would create an invalid color processor if not. This commit now
checks whether the new display contains the current view, and sets the default
view for the new display if not.
This commit is contained in:
itsmattkc
2020-03-17 03:13:14 +11:00
parent a1f5c85f49
commit 69e65f6784
+8
View File
@@ -129,6 +129,14 @@ void ViewerGLWidget::SetImage(const QString &fn)
void ViewerGLWidget::SetOCIODisplay(const QString &display)
{
ocio_display_ = display;
// Determine if the selected view is available in this display
if (color_manager_
&& !color_manager_->ListAvailableViews(ocio_display_).contains(ocio_view_)) {
// If not, set to the default view for this display
ocio_view_ = color_manager_->GetDefaultView(ocio_display_);
}
SetupColorProcessor();
update();
}