Commit 4d74341c authored by Craig Watson's avatar Craig Watson

Fixed pen strokes' zLevels not being saved to file (Issue #12)

parent 3c44bfb9
...@@ -1111,7 +1111,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) ...@@ -1111,7 +1111,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
if (colorOnDarkBackground.isValid() && colorOnLightBackground.isValid()) if (colorOnDarkBackground.isValid() && colorOnLightBackground.isValid())
{ {
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "z-value" mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "z-value"
, QString("%1").arg(polygonItem->zValue())); , QString("%1").arg(polygonItem->strokesGroup()->zValue()));
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri
, "fill-on-dark-background", colorOnDarkBackground.name()); , "fill-on-dark-background", colorOnDarkBackground.name());
......
...@@ -262,6 +262,10 @@ qreal UBZLayerController::changeZLevelTo(QGraphicsItem *item, moveDestination de ...@@ -262,6 +262,10 @@ qreal UBZLayerController::changeZLevelTo(QGraphicsItem *item, moveDestination de
} }
//Return new z value assigned to item //Return new z value assigned to item
// experimental
item->setZValue(item->data(UBGraphicsItemData::ItemOwnZValue).toReal());
return item->data(UBGraphicsItemData::ItemOwnZValue).toReal(); return item->data(UBGraphicsItemData::ItemOwnZValue).toReal();
} }
......
...@@ -185,6 +185,7 @@ void UBGraphicsStrokesGroup::copyItemParameters(UBItem *copy) const ...@@ -185,6 +185,7 @@ void UBGraphicsStrokesGroup::copyItemParameters(UBItem *copy) const
cp->setFlag(QGraphicsItem::ItemIsSelectable, true); cp->setFlag(QGraphicsItem::ItemIsSelectable, true);
cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType));
cp->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked)); cp->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked));
cp->setZValue(this->zValue());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment