Skip to content

Commit

Permalink
fixed issue #21 (small image + normal map size 10% -> crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
Theverat committed Apr 20, 2017
1 parent 1c68fdd commit 5dcc7c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src_gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,11 @@ void MainWindow::normalmapSizeChanged() {
ui->label_normalmapSize->setText(text);
}

// Used to scale down the input image if a value less than 100
// is set in spinBox_normalmapSize. We have to make sure size is at least 1
int MainWindow::calcPercentage(int value, int percentage) {
return (int) (((double)value / 100.0) * percentage);
const int newValue = (((double)value / 100.0) * percentage);
return std::max(newValue, 1);
}

void MainWindow::showAboutDialog() {
Expand Down

0 comments on commit 5dcc7c9

Please sign in to comment.