We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c68fdd commit 5dcc7c9Copy full SHA for 5dcc7c9
src_gui/mainwindow.cpp
@@ -899,8 +899,11 @@ void MainWindow::normalmapSizeChanged() {
899
ui->label_normalmapSize->setText(text);
900
}
901
902
+// Used to scale down the input image if a value less than 100
903
+// is set in spinBox_normalmapSize. We have to make sure size is at least 1
904
int MainWindow::calcPercentage(int value, int percentage) {
- return (int) (((double)value / 100.0) * percentage);
905
+ const int newValue = (((double)value / 100.0) * percentage);
906
+ return std::max(newValue, 1);
907
908
909
void MainWindow::showAboutDialog() {
0 commit comments