修改引用Element的Layer的styles类型为ALL | #32

main
karlis 2023-03-27 15:06:53 +08:00
parent 4471bb3f79
commit a0d45085dd
1 changed files with 10 additions and 3 deletions

View File

@ -82,9 +82,16 @@ LeafLayerWrapper::LeafLayerWrapper(QJsonObject json, ElementManager* elementMana
: LayerWrapper(json, parent, elementManager), : LayerWrapper(json, parent, elementManager),
wrappedElement(elementManager->getElementById(json.value("element").toInt())) wrappedElement(elementManager->getElementById(json.value("element").toInt()))
{ {
styles = new LayerStyleContainer(LayerStyleContainer::fromJson( if (typeid(*wrappedElement) == typeid(GroupElement))
wrappedElement->isClosed() ? ElementType::TYPE_CLOSED : ElementType::TYPE_UNCLOSED, {
json.value("styles").toArray())); styles = new LayerStyleContainer(ElementType::TYPE_ALL);
}
else
{
styles = new LayerStyleContainer(LayerStyleContainer::fromJson(
wrappedElement->isClosed() ? ElementType::TYPE_CLOSED : ElementType::TYPE_UNCLOSED,
json.value("styles").toArray()));
}
qDebug() << json.value("name").toString() << " " << this; qDebug() << json.value("name").toString() << " " << this;
if(wrappedElement != nullptr) if(wrappedElement != nullptr)
wrappedElement->referencedCount++; wrappedElement->referencedCount++;