fixed erasing problems

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 3be48374dc
commit aae05d172b
  1. 25
      src/adaptors/UBSvgSubsetAdaptor.cpp

@ -392,6 +392,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mFileVersion = 40100; // default to 4.1.0 mFileVersion = 40100; // default to 4.1.0
UBGraphicsStrokesGroup* strokesGroup = 0; UBGraphicsStrokesGroup* strokesGroup = 0;
UBGraphicsStroke* currentStroke = 0;
while (!mXmlReader.atEnd()) while (!mXmlReader.atEnd())
{ {
@ -559,11 +560,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{ {
polygonItem->setUuid(uuidFromSvg); polygonItem->setUuid(uuidFromSvg);
if(strokesGroup){
polygonItem->setTransform(strokesGroup->transform());
strokesGroup->addToGroup(polygonItem);
polygonItem->setStrokesGroup(strokesGroup);
}
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic)); polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
@ -571,10 +567,16 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if(!mStrokesList.contains(parentId)){ if(!mStrokesList.contains(parentId)){
group = new UBGraphicsStrokesGroup(); group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group); mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke();
} }
else else
group = mStrokesList.value(parentId); group = mStrokesList.value(parentId);
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke);
polygonItem->show(); polygonItem->show();
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
@ -589,23 +591,22 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
foreach(UBGraphicsPolygonItem* polygonItem, polygonItems) foreach(UBGraphicsPolygonItem* polygonItem, polygonItems)
{ {
if(strokesGroup){
polygonItem->setTransform(strokesGroup->transform());
strokesGroup->addToGroup(polygonItem);
polygonItem->setStrokesGroup(strokesGroup);
}
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic)); polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
UBGraphicsStrokesGroup* group; UBGraphicsStrokesGroup* group;
if(!mStrokesList.contains(parentId)){ if(!mStrokesList.contains(parentId)){
group = new UBGraphicsStrokesGroup(); group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group); mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke();
} }
else else
group = mStrokesList.value(parentId); group = mStrokesList.value(parentId);
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke);
polygonItem->show(); polygonItem->show();
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
} }

Loading…
Cancel
Save