Fix projection guessing controls sometimes being enabled when unused

This commit is contained in:
baldurk
2019-12-13 16:36:30 +00:00
parent 222816c537
commit 24e4f4179f
2 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -2239,8 +2239,6 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
ClearModels();
}
EnableCameraGuessControls();
bufdata->vsinConfig.curInstance = bufdata->vsoutConfig.curInstance =
bufdata->gsoutConfig.curInstance = m_Config.curInstance;
bufdata->vsinConfig.curView = bufdata->vsoutConfig.curView = bufdata->gsoutConfig.curView =
@@ -2361,6 +2359,8 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
bufdata->gsoutConfig.columnName(m_ModelGSOut->secondaryColumn()))
m_ModelGSOut->setSecondaryColumn(-1, m_Config.solidShadeMode == SolidShade::Secondary, false);
EnableCameraGuessControls();
populateBBox(bufdata);
UI_CalculateMeshFormats();
@@ -3438,6 +3438,8 @@ void BufferViewer::camGuess_changed(double value)
if(ui->farGuess->value() > 0.0)
m_Config.position.nearPlane = ui->farGuess->value();
EnableCameraGuessControls();
INVOKE_MEMFN(RT_UpdateAndDisplay);
}
@@ -3800,9 +3802,13 @@ void BufferViewer::UpdateHighlightVerts()
void BufferViewer::EnableCameraGuessControls()
{
ui->matrixType->setEnabled(isCurrentRasterOut());
ui->aspectGuess->setEnabled(isCurrentRasterOut());
ui->nearGuess->setEnabled(isCurrentRasterOut());
ui->farGuess->setEnabled(isCurrentRasterOut());
// FOV is only available in perspective mode
ui->fovGuess->setEnabled(isCurrentRasterOut() && ui->matrixType->currentIndex() == 0);
}
void BufferViewer::on_outputTabs_currentChanged(int index)
+2 -2
View File
@@ -443,8 +443,8 @@
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="guessInstructions">
<property name="text">
<string>Manually set auto-guessed values
0.0 to use automatic value</string>
<string>Manually configure projection used by vertex pipeline.
Enter 0.0 to use automatic/guessed value derived from data.</string>
</property>
</widget>
</item>