Read and save a spline path attribute 'duplicate'.
--HG-- branch : feature
This commit is contained in:
parent
c80fe9c61b
commit
0846d3c282
|
@ -1894,7 +1894,13 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
|
|||
ToolsCommonAttributes(domElement, id);
|
||||
const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0");
|
||||
const QString color = GetParametrString(domElement, AttrColor, ColorBlack);
|
||||
VSplinePath *path = new VSplinePath(kCurve);
|
||||
const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0");
|
||||
|
||||
auto path = new VSplinePath(kCurve);
|
||||
if (duplicate > 0)
|
||||
{
|
||||
path->SetDuplicate(duplicate);
|
||||
}
|
||||
|
||||
const QDomNodeList nodeList = domElement.childNodes();
|
||||
const qint32 num = nodeList.size();
|
||||
|
|
|
@ -404,6 +404,18 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &ob
|
|||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrKCurve, splPath->GetKCurve());
|
||||
|
||||
if (splPath->GetDuplicate() > 0)
|
||||
{
|
||||
doc->SetAttribute(tag, AttrDuplicate, splPath->GetDuplicate());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tag.hasAttribute(AttrDuplicate))
|
||||
{
|
||||
tag.removeAttribute(AttrDuplicate);
|
||||
}
|
||||
}
|
||||
|
||||
doc->RemoveAllChild(tag);
|
||||
for (qint32 i = 0; i < splPath->CountPoint(); ++i)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user