Commit 03edf4f5 authored by Claudio Valerio's avatar Claudio Valerio

fixed deep copy

parent fc87cb06
...@@ -174,14 +174,10 @@ QColor UBGraphicsPolygonItem::color() const ...@@ -174,14 +174,10 @@ QColor UBGraphicsPolygonItem::color() const
UBItem* UBGraphicsPolygonItem::deepCopy() const UBItem* UBGraphicsPolygonItem::deepCopy() const
{ {
UBGraphicsPolygonItem* copy = new UBGraphicsPolygonItem(polygon(), 0); // UBGraphicsPolygonItem* copy = new UBGraphicsPolygonItem(polygon(), 0);
UBGraphicsPolygonItem* copy = new UBGraphicsPolygonItem();
UBGraphicsStroke *stroke = new UBGraphicsStroke();
copyItemParameters(copy); copyItemParameters(copy);
copy->setStroke(stroke);
return copy; return copy;
} }
...@@ -204,6 +200,7 @@ void UBGraphicsPolygonItem::copyItemParameters(UBItem *copy) const ...@@ -204,6 +200,7 @@ void UBGraphicsPolygonItem::copyItemParameters(UBItem *copy) const
cp->setColorOnLightBackground(this->colorOnLightBackground()); cp->setColorOnLightBackground(this->colorOnLightBackground());
cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType));
cp->setPolygon(polygon());
} }
} }
......
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