Fix: 导出设置图像大小输入框Bug

main
wuyize 2023-04-25 15:03:17 +08:00
parent dad2c1fa59
commit fb85447a2f
1 changed files with 2 additions and 2 deletions

View File

@ -189,10 +189,10 @@ void EditorWidgetItem::exportAs()
supersampleTextField.setText(QString::number(2)); supersampleTextField.setText(QString::number(2));
connect(&widthTextField, &QLineEdit::textChanged, [&](const QString& string) { connect(&widthTextField, &QLineEdit::textChanged, [&](const QString& string) {
heightTextField.setText(QString::number(previewWindow->referSize.height() * string.toInt() / (double)previewWindow->referSize.width())); heightTextField.setText(QString::number((int)std::round(previewWindow->referSize.height() * string.toInt() / (double)previewWindow->referSize.width())));
}); });
connect(&heightTextField, &QLineEdit::textChanged, [&](const QString& string) { connect(&heightTextField, &QLineEdit::textChanged, [&](const QString& string) {
widthTextField.setText(QString::number(previewWindow->referSize.width() * string.toInt() / (double)previewWindow->referSize.height())); widthTextField.setText(QString::number((int)std::round(previewWindow->referSize.width()* string.toInt() / (double)previewWindow->referSize.height())));
}); });
QDialog* dialog = new QDialog(this); QDialog* dialog = new QDialog(this);