Fix issue with Custom template.

This commit is contained in:
Roman Telezhynskyi 2022-02-18 19:18:19 +02:00
parent d913ec281b
commit 9cddf75d97
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Valentina 0.7.51 (unreleased) # Valentina 0.7.51 (unreleased)
- Z value change for a layout piece. - Z value change for a layout piece.
- Fix issue with Custom template.
# Valentina 0.7.50 February 14, 2022 # Valentina 0.7.50 February 14, 2022
- Fix regression. Minimal seam allowance width is less than the point accuracy values. - Fix regression. Minimal seam allowance width is less than the point accuracy values.

View File

@ -1935,7 +1935,6 @@ auto VPMainWindow::Template(VAbstractLayoutDialog::PaperSizeTemplate t) const ->
case VAbstractLayoutDialog::PaperSizeTemplate::Letter: case VAbstractLayoutDialog::PaperSizeTemplate::Letter:
case VAbstractLayoutDialog::PaperSizeTemplate::Legal: case VAbstractLayoutDialog::PaperSizeTemplate::Legal:
case VAbstractLayoutDialog::PaperSizeTemplate::Tabloid: case VAbstractLayoutDialog::PaperSizeTemplate::Tabloid:
return VAbstractLayoutDialog::GetTemplateSize(t, layoutUnit);
case VAbstractLayoutDialog::PaperSizeTemplate::Roll24in: case VAbstractLayoutDialog::PaperSizeTemplate::Roll24in:
case VAbstractLayoutDialog::PaperSizeTemplate::Roll30in: case VAbstractLayoutDialog::PaperSizeTemplate::Roll30in:
case VAbstractLayoutDialog::PaperSizeTemplate::Roll36in: case VAbstractLayoutDialog::PaperSizeTemplate::Roll36in:
@ -1946,17 +1945,22 @@ auto VPMainWindow::Template(VAbstractLayoutDialog::PaperSizeTemplate t) const ->
case VAbstractLayoutDialog::PaperSizeTemplate::Roll72in: case VAbstractLayoutDialog::PaperSizeTemplate::Roll72in:
return VAbstractLayoutDialog::GetTemplateSize(t, layoutUnit); return VAbstractLayoutDialog::GetTemplateSize(t, layoutUnit);
case VAbstractLayoutDialog::PaperSizeTemplate::Custom: case VAbstractLayoutDialog::PaperSizeTemplate::Custom:
return VAbstractLayoutDialog::GetTemplateSize(t, layoutUnit);
default: default:
break; break;
} }
return QSizeF(); return {};
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPMainWindow::SheetTemplate() const -> QSizeF auto VPMainWindow::SheetTemplate() const -> QSizeF
{ {
auto t = static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(ui->comboBoxSheetTemplates->currentData().toInt()); auto t = static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(ui->comboBoxSheetTemplates->currentData().toInt());
if (t == VAbstractLayoutDialog::PaperSizeTemplate::Custom)
{
return {ui->doubleSpinBoxSheetPaperWidth->value(), ui->doubleSpinBoxSheetPaperHeight->value()};
}
return Template(t); return Template(t);
} }
@ -1964,6 +1968,12 @@ auto VPMainWindow::SheetTemplate() const -> QSizeF
auto VPMainWindow::TileTemplate() const -> QSizeF auto VPMainWindow::TileTemplate() const -> QSizeF
{ {
auto t = static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(ui->comboBoxTileTemplates->currentData().toInt()); auto t = static_cast<VAbstractLayoutDialog::PaperSizeTemplate>(ui->comboBoxTileTemplates->currentData().toInt());
if (t == VAbstractLayoutDialog::PaperSizeTemplate::Custom)
{
return {ui->doubleSpinBoxTilePaperWidth->value(), ui->doubleSpinBoxTilePaperHeight->value()};
}
return Template(t); return Template(t);
} }