diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp
index fa5141149..63e75885b 100644
--- a/src/app/valentina/xml/vpattern.cpp
+++ b/src/app/valentina/xml/vpattern.cpp
@@ -138,7 +138,7 @@ void VPattern::Parse(const Document &parse)
QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes
<< TagMeasurements << TagVersion << TagGradation << TagImage << TagUnit
<< TagPatternName << TagPatternNum << TagCompanyName << TagCustomerName
- << TagCreationDate << TagLabelPos << TagLabelWidth << TagLabelFont;
+ << TagCreationDate << TagLabelPos << TagLabelSize << TagLabelFont;
PrepareForParse(parse);
QDomNode domNode = documentElement().firstChild();
while (domNode.isNull() == false)
@@ -216,8 +216,8 @@ void VPattern::Parse(const Document &parse)
case 15: // TagLabelPos
qCDebug(vXML, "Label position.");
break;
- case 16: // TagLabelWidth
- qCDebug(vXML, "Label width.");
+ case 16: // TagLabelSize
+ qCDebug(vXML, "Label size.");
break;
case 17: // TagLabelFont
qCDebug(vXML, "Label font size.");
@@ -614,11 +614,6 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
{
- QString qs;
- QTextStream ts(&qs, QIODevice::WriteOnly);
- domElement.save(ts, 2);
- qDebug() << "Parse detail" << qs;
-
VDetail detail;
const quint32 id = GetParametrId(domElement);
detail.setName(GetParametrString(domElement, AttrName, ""));
@@ -681,6 +676,11 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
detail.GetPatternPieceData().SetPos(ptPos);
qreal dLW = element.attribute(VToolDetail::AttrWidth, "0").toDouble();
detail.GetPatternPieceData().SetLabelWidth(dLW);
+ qreal dLH = element.attribute(VToolDetail::AttrHeight, "0").toDouble();
+ detail.GetPatternPieceData().SetLabelHeight(dLH);
+ qDebug() << "HEIGHT" <<
+ detail.GetPatternPieceData().GetPos() <<
+ detail.GetPatternPieceData().GetLabelHeight();
int iFS = element.attribute(VToolDetail::AttrFont, "0").toInt();
detail.GetPatternPieceData().SetFontSize(iFS);
diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc
index fe077d4dc..04fbb08f5 100644
--- a/src/libs/ifc/schema.qrc
+++ b/src/libs/ifc/schema.qrc
@@ -25,5 +25,6 @@
schema/individual_measurements/v0.3.1.xsd
schema/individual_measurements/v0.3.2.xsd
schema/individual_measurements/v0.3.3.xsd
+ schema/pattern/v0.3.3.xsd
diff --git a/src/libs/ifc/schema/pattern/v0.3.3.xsd b/src/libs/ifc/schema/pattern/v0.3.3.xsd
new file mode 100644
index 000000000..64d1650d6
--- /dev/null
+++ b/src/libs/ifc/schema/pattern/v0.3.3.xsd
@@ -0,0 +1,545 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp
index fc9a8e0ae..ca24447e5 100644
--- a/src/libs/ifc/xml/vabstractpattern.cpp
+++ b/src/libs/ifc/xml/vabstractpattern.cpp
@@ -68,7 +68,7 @@ const QString VAbstractPattern::TagCustomerName = QStringLiteral("customer");
const QString VAbstractPattern::TagCompanyName = QStringLiteral("company");
const QString VAbstractPattern::TagCreationDate = QStringLiteral("created");
const QString VAbstractPattern::TagLabelPos = QStringLiteral("labelPosition");
-const QString VAbstractPattern::TagLabelWidth = QStringLiteral("labelWidth");
+const QString VAbstractPattern::TagLabelSize = QStringLiteral("labelSize");
const QString VAbstractPattern::TagLabelFont = QStringLiteral("fontSize");
const QString VAbstractPattern::AttrName = QStringLiteral("name");
@@ -1108,22 +1108,30 @@ void VAbstractPattern::SetLabelPosition(const QPointF& ptPos)
}
//---------------------------------------------------------------------------------------------------------------------
-qreal VAbstractPattern::GetLabelWidth() const
+QSizeF VAbstractPattern::GetLabelSize() const
{
- bool bOK;
- qreal fW = UniqueTagText(TagLabelWidth).toDouble(&bOK);
- if (bOK == false)
+ QStringList qsl = UniqueTagText(TagLabelSize).split(",");
+ QSizeF sz(0, 0);
+ if (qsl.count() == 2)
{
- fW = 0;
+ bool bOKW;
+ bool bOKH;
+ double fW = qsl[0].toDouble(&bOKW);
+ double fH = qsl[1].toDouble(&bOKH);
+ if (bOKW == true && bOKH == true)
+ {
+ sz.setWidth(fW);
+ sz.setHeight(fH);
+ }
}
- return fW;
+ return sz;
}
//---------------------------------------------------------------------------------------------------------------------
-void VAbstractPattern::SetLabelWidth(qreal fW)
+void VAbstractPattern::SetLabelSize(QSizeF sz)
{
- CheckTagExists(TagLabelWidth);
- setTagText(TagLabelWidth, QString::number(fW, 'f', 3));
+ CheckTagExists(TagLabelSize);
+ setTagText(TagLabelSize, QString::number(sz.width(), 'f', 3) + "," + QString::number(sz.height(), 'f', 3));
modified = true;
emit patternChanged(false);
}
@@ -1274,7 +1282,7 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag)
{
const QStringList tags = QStringList() << TagUnit << TagImage << TagAuthor << TagDescription << TagNotes
<< TagGradation << TagPatternName << TagPatternNum << TagCompanyName
- << TagCustomerName << TagCreationDate << TagLabelPos << TagLabelWidth
+ << TagCustomerName << TagCreationDate << TagLabelPos << TagLabelSize
<< TagLabelFont;
switch (tags.indexOf(tag))
{
@@ -1348,7 +1356,7 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag)
}
case 12:
{
- element = createElement(TagLabelWidth);
+ element = createElement(TagLabelSize);
break;
}
case 13:
diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h
index fe6a44094..f0dc2dcf0 100644
--- a/src/libs/ifc/xml/vabstractpattern.h
+++ b/src/libs/ifc/xml/vabstractpattern.h
@@ -119,8 +119,8 @@ public:
QDate GetCreationDate() const;
QPointF GetLabelPosition() const;
void SetLabelPosition(const QPointF& ptPos);
- qreal GetLabelWidth() const;
- void SetLabelWidth(qreal fW);
+ QSizeF GetLabelSize() const;
+ void SetLabelSize(QSizeF sz);
int GetFontSize() const;
void SetFontSize(int iFS);
@@ -180,7 +180,7 @@ public:
static const QString TagCustomerName;
static const QString TagCreationDate;
static const QString TagLabelPos;
- static const QString TagLabelWidth;
+ static const QString TagLabelSize;
static const QString TagLabelFont;
static const QString AttrName;
diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp
index cb16a65fc..2e9fe11d1 100644
--- a/src/libs/ifc/xml/vpatternconverter.cpp
+++ b/src/libs/ifc/xml/vpatternconverter.cpp
@@ -43,8 +43,8 @@
*/
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0");
-const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.2");
-const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.2.xsd");
+const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.3");
+const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.3.xsd");
//---------------------------------------------------------------------------------------------------------------------
VPatternConverter::VPatternConverter(const QString &fileName)
@@ -117,6 +117,8 @@ QString VPatternConverter::XSDSchema(int ver) const
case (0x000301):
return QStringLiteral("://schema/pattern/v0.3.1.xsd");
case (0x000302):
+ return QStringLiteral("://schema/pattern/v0.3.2.xsd");
+ case (0x000303):
return CurrentSchema;
default:
InvalidVersion(ver);
diff --git a/src/libs/vpatterndb/vpatternpiecedata.cpp b/src/libs/vpatterndb/vpatternpiecedata.cpp
index 560d776a6..7b939a770 100644
--- a/src/libs/vpatterndb/vpatternpiecedata.cpp
+++ b/src/libs/vpatterndb/vpatternpiecedata.cpp
@@ -141,6 +141,18 @@ void VPatternPieceData::SetLabelWidth(qreal dLabelW)
m_dLabelWidth = dLabelW;
}
+//---------------------------------------------------------------------------------------------------------------------
+qreal VPatternPieceData::GetLabelHeight() const
+{
+ return m_dLabelHeight;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VPatternPieceData::SetLabelHeight(qreal dLabelH)
+{
+ m_dLabelHeight = dLabelH;
+}
+
//---------------------------------------------------------------------------------------------------------------------
int VPatternPieceData::GetFontSize() const
{
diff --git a/src/libs/vpatterndb/vpatternpiecedata.h b/src/libs/vpatterndb/vpatternpiecedata.h
index aee873fbb..ab0295d82 100644
--- a/src/libs/vpatterndb/vpatternpiecedata.h
+++ b/src/libs/vpatterndb/vpatternpiecedata.h
@@ -89,6 +89,8 @@ public:
void SetPos(const QPointF& ptPos);
qreal GetLabelWidth() const;
void SetLabelWidth(qreal dLabelW);
+ qreal GetLabelHeight() const;
+ void SetLabelHeight(qreal dLabelH);
int GetFontSize() const;
void SetFontSize(int iSize);
@@ -108,6 +110,9 @@ private:
/** @brief Label width
*/
qreal m_dLabelWidth;
+ /** @brief Label height
+ */
+ qreal m_dLabelHeight;
/** @brief Label font size
*/
int m_iFontSize;
diff --git a/src/libs/vtools/tools/vtextgraphicsitem.cpp b/src/libs/vtools/tools/vtextgraphicsitem.cpp
index 1d27cc508..121e6c6f5 100644
--- a/src/libs/vtools/tools/vtextgraphicsitem.cpp
+++ b/src/libs/vtools/tools/vtextgraphicsitem.cpp
@@ -50,7 +50,7 @@ VTextGraphicsItem::VTextGraphicsItem(QGraphicsItem* pParent)
m_eMode = mNormal;
m_rectBoundingBox.setTopLeft(QPointF(0, 0));
m_iMinH = MIN_H;
- Resize(MIN_W, m_iMinH);
+ SetSize(MIN_W, m_iMinH);
setZValue(2);
}
@@ -71,7 +71,7 @@ void VTextGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
// draw text lines
int iY = 0;
- int iH;
+ int iH = 0;
painter->setPen(Qt::black);
QFont fnt = m_font;
for (int i = 0; i < m_liOutput.count(); ++i)
@@ -104,6 +104,14 @@ void VTextGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void VTextGraphicsItem::Reset()
+{
+ m_eMode = mNormal;
+ Update();
+ setZValue(2);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VTextGraphicsItem::AddLine(const TextLine& tl)
{
@@ -114,7 +122,7 @@ void VTextGraphicsItem::AddLine(const TextLine& tl)
}
if (m_rectBoundingBox.height() < m_iMinH)
{
- Resize(m_rectBoundingBox.width(), m_iMinH);
+ SetSize(m_rectBoundingBox.width(), m_iMinH);
}
}
@@ -125,31 +133,7 @@ void VTextGraphicsItem::Clear()
}
//---------------------------------------------------------------------------------------------------------------------
-void VTextGraphicsItem::SetWidth(qreal fW)
-{
- if (fW < MIN_W)
- {
- fW = MIN_W;
- }
- m_rectBoundingBox.setWidth(fW);
-}
-
-//---------------------------------------------------------------------------------------------------------------------
-void VTextGraphicsItem::Reset()
-{
- m_eMode = mNormal;
- UpdateFont();
- setZValue(2);
-}
-
-//---------------------------------------------------------------------------------------------------------------------
-QRectF VTextGraphicsItem::boundingRect() const
-{
- return m_rectBoundingBox;
-}
-
-//---------------------------------------------------------------------------------------------------------------------
-void VTextGraphicsItem::Resize(qreal fW, qreal fH)
+void VTextGraphicsItem::SetSize(qreal fW, qreal fH)
{
// don't allow resize under specific size
if (fW < MIN_W || fH < m_iMinH)
@@ -162,6 +146,19 @@ void VTextGraphicsItem::Resize(qreal fW, qreal fH)
m_rectResize.setHeight(RESIZE_SQUARE);
}
+//---------------------------------------------------------------------------------------------------------------------
+void VTextGraphicsItem::Update()
+{
+ UpdateFont();
+ UpdateBox();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+QRectF VTextGraphicsItem::boundingRect() const
+{
+ return m_rectBoundingBox;
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VTextGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *pME)
{
@@ -176,7 +173,7 @@ void VTextGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *pME)
m_eMode = mMove;
}
setZValue(3);
- Update();
+ UpdateBox();
}
//---------------------------------------------------------------------------------------------------------------------
@@ -186,12 +183,12 @@ void VTextGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent* pME)
if (m_eMode == mMove)
{
moveBy(ptDiff.x(), ptDiff.y());
- Update();
+ UpdateBox();
}
else if (m_eMode == mResize)
{
- Resize(m_szStart.width() + ptDiff.x(), m_szStart.height() + ptDiff.y());
- UpdateFont();
+ SetSize(m_szStart.width() + ptDiff.x(), m_szStart.height() + ptDiff.y());
+ Update();
emit SignalShrink();
}
}
@@ -202,17 +199,18 @@ void VTextGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* pME)
if (m_eMode == mMove)
{
emit SignalMoved(pos());
+ UpdateBox();
}
else
{
emit SignalResized(m_rectBoundingBox.width(), m_font.pixelSize());
+ Update();
}
m_eMode = mActivated;
- Update();
}
//---------------------------------------------------------------------------------------------------------------------
-void VTextGraphicsItem::Update()
+void VTextGraphicsItem::UpdateBox()
{
update(m_rectBoundingBox);
}
@@ -233,7 +231,7 @@ void VTextGraphicsItem::UpdateFont()
--iFS;
}
m_font.setPixelSize(iFS);
- Update();
+ UpdateBox();
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/tools/vtextgraphicsitem.h b/src/libs/vtools/tools/vtextgraphicsitem.h
index caed2f7c8..62991aba4 100644
--- a/src/libs/vtools/tools/vtextgraphicsitem.h
+++ b/src/libs/vtools/tools/vtextgraphicsitem.h
@@ -66,14 +66,14 @@ public:
QRectF boundingRect() const;
void AddLine(const TextLine& tl);
void Clear();
- void SetWidth(qreal fW);
+ void SetSize(qreal fW, qreal fH);
+ void Update();
protected:
- void Resize(qreal fW, qreal fH);
void mousePressEvent(QGraphicsSceneMouseEvent* pME);
void mouseMoveEvent(QGraphicsSceneMouseEvent* pME);
void mouseReleaseEvent(QGraphicsSceneMouseEvent* pME);
- void Update();
+ void UpdateBox();
void UpdateFont();
bool IsBigEnough(qreal fW, qreal fH, int iFontSize);
QStringList SplitString(const QString& qs, qreal fW, const QFontMetrics& fm);
diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp
index f4430d494..cc80d74a4 100644
--- a/src/libs/vtools/tools/vtooldetail.cpp
+++ b/src/libs/vtools/tools/vtooldetail.cpp
@@ -53,6 +53,7 @@ const QString VToolDetail::TagNode = QStringLiteral("node");
const QString VToolDetail::AttrSupplement = QStringLiteral("supplement");
const QString VToolDetail::AttrClosed = QStringLiteral("closed");
const QString VToolDetail::AttrWidth = QStringLiteral("width");
+const QString VToolDetail::AttrHeight = QStringLiteral("height");
const QString VToolDetail::AttrNodeType = QStringLiteral("nodeType");
const QString VToolDetail::AttrReverse = QStringLiteral("reverse");
const QString VToolDetail::AttrFont = QStringLiteral("fontSize");
@@ -351,6 +352,7 @@ void VToolDetail::AddToFile()
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
doc->SetAttribute(domData, AttrWidth, data.GetLabelWidth());
+ doc->SetAttribute(domData, AttrHeight, data.GetLabelHeight());
doc->SetAttribute(domData, AttrFont, data.GetFontSize());
for (int i = 0; i < data.GetMCPCount(); ++i)
@@ -398,6 +400,7 @@ void VToolDetail::RefreshDataInFile()
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
doc->SetAttribute(domData, AttrWidth, data.GetLabelWidth());
+ doc->SetAttribute(domData, AttrHeight, data.GetLabelHeight());
doc->SetAttribute(domData, AttrFont, data.GetFontSize());
for (int i = 0; i < data.GetMCPCount(); ++i)
@@ -648,12 +651,15 @@ void VToolDetail::UpdateLabel()
const VPatternPieceData& data = detail.GetPatternPieceData();
if (data.GetLetter().isEmpty() == false || data.GetName().isEmpty() == false || data.GetMCPCount() > 0)
{
+ dataLabel->Reset();
+
QString qsText = "Cut %1 of %2%3";
QStringList qslPlace;
qslPlace << "" << " on Fold";
QFont fnt = qApp->font();
fnt.setPixelSize(data.GetFontSize());
dataLabel->SetFont(fnt);
+ dataLabel->SetSize(data.GetLabelWidth(), data.GetLabelHeight());
dataLabel->Clear();
TextLine tl;
// letter
@@ -679,7 +685,7 @@ void VToolDetail::UpdateLabel()
}
dataLabel->setPos(data.GetPos());
- dataLabel->Reset();
+ dataLabel->Update();
dataLabel->show();
}
else
@@ -694,6 +700,7 @@ void VToolDetail::UpdateLabel()
*/
void VToolDetail::UpdatePatternInfo()
{
+ patternInfo->Reset();
QFont fnt = qApp->font();
int iFS = doc->GetFontSize();
if (iFS < MIN_FONT_SIZE)
@@ -702,7 +709,8 @@ void VToolDetail::UpdatePatternInfo()
}
fnt.setPixelSize(iFS);
patternInfo->SetFont(fnt);
- patternInfo->SetWidth(doc->GetLabelWidth());
+ QSizeF sz = doc->GetLabelSize();
+ patternInfo->SetSize(sz.width(), sz.height());
patternInfo->Clear();
TextLine tl;
@@ -736,9 +744,8 @@ void VToolDetail::UpdatePatternInfo()
tl.m_qsText = qslDate.last();
patternInfo->AddLine(tl);
- qDebug() << "UpdatePatternInfo" << doc->GetLabelPosition() << sender();
patternInfo->setPos(doc->GetLabelPosition());
- patternInfo->Reset();
+ patternInfo->Update();
}
//---------------------------------------------------------------------------------------------------------------------
@@ -766,6 +773,7 @@ void VToolDetail::SaveResizeDetail(qreal dLabelW, int iFontSize)
VDetail oldDet = VAbstractTool::data.GetDetail(id);
VDetail newDet = oldDet;
newDet.GetPatternPieceData().SetLabelWidth(dLabelW);
+ newDet.GetPatternPieceData().SetLabelHeight(dataLabel->boundingRect().height());
newDet.GetPatternPieceData().SetFontSize(iFontSize);
SaveDetailOptions* resizeCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene());
resizeCommand->setText(tr("resize pattern piece label"));
@@ -789,7 +797,7 @@ void VToolDetail::SaveMovePattern(QPointF ptPos)
*/
void VToolDetail::SaveResizePattern(qreal dLabelW, int iFontSize)
{
- doc->SetLabelWidth(dLabelW);
+ doc->SetLabelSize(QSizeF(dLabelW, patternInfo->boundingRect().height()));
doc->SetFontSize(iFontSize);
}
diff --git a/src/libs/vtools/tools/vtooldetail.h b/src/libs/vtools/tools/vtooldetail.h
index a68891276..eed34865f 100644
--- a/src/libs/vtools/tools/vtooldetail.h
+++ b/src/libs/vtools/tools/vtooldetail.h
@@ -69,6 +69,7 @@ public:
static const QString AttrSupplement;
static const QString AttrClosed;
static const QString AttrWidth;
+ static const QString AttrHeight;
static const QString AttrNodeType;
static const QString AttrReverse;
static const QString AttrFont;
diff --git a/src/libs/vtools/undocommands/savedetailoptions.cpp b/src/libs/vtools/undocommands/savedetailoptions.cpp
index 47e94f147..bc30cdca8 100644
--- a/src/libs/vtools/undocommands/savedetailoptions.cpp
+++ b/src/libs/vtools/undocommands/savedetailoptions.cpp
@@ -140,6 +140,7 @@ void SaveDetailOptions::SavePatternPieceData(QDomElement &domElement, const VDet
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
doc->SetAttribute(domData, AttrMy, data.GetPos().y());
doc->SetAttribute(domData, VToolDetail::AttrWidth, data.GetLabelWidth());
+ doc->SetAttribute(domData, VToolDetail::AttrHeight, data.GetLabelHeight());
doc->SetAttribute(domData, VToolDetail::AttrFont, data.GetFontSize());
for (int i = 0; i < data.GetMCPCount(); ++i)
{