diff --git a/src/app/puzzle/xml/vplayoutfilewriter.cpp b/src/app/puzzle/xml/vplayoutfilewriter.cpp index a9c0ad140..88a702471 100644 --- a/src/app/puzzle/xml/vplayoutfilewriter.cpp +++ b/src/app/puzzle/xml/vplayoutfilewriter.cpp @@ -169,10 +169,10 @@ void VPLayoutFileWriter::WritePiece(VPPiece *piece) void VPLayoutFileWriter::WriteMargins(const QMarginsF &margins) { writeStartElement(ML::TagMargin); - SetAttribute(ML::AttrLeft, margins.left()); - SetAttribute(ML::AttrTop, margins.top()); - SetAttribute(ML::AttrRight, margins.right()); - SetAttribute(ML::AttrBottom, margins.bottom()); + SetAttributeOrRemoveIf(ML::AttrLeft, margins.left(), [](qreal margin){return margin <= 0;}); + SetAttributeOrRemoveIf(ML::AttrTop, margins.top(), [](qreal margin){return margin <= 0;}); + SetAttributeOrRemoveIf(ML::AttrRight, margins.right(), [](qreal margin){return margin <= 0;}); + SetAttributeOrRemoveIf(ML::AttrBottom, margins.bottom(), [](qreal margin){return margin <= 0;}); writeEndElement(); // margin }