diff --git a/ArchitectureColoredPainting/src/Editor/LayerWrapper.cpp b/ArchitectureColoredPainting/src/Editor/LayerWrapper.cpp index 0f203f8..7c52d1a 100644 --- a/ArchitectureColoredPainting/src/Editor/LayerWrapper.cpp +++ b/ArchitectureColoredPainting/src/Editor/LayerWrapper.cpp @@ -82,9 +82,16 @@ LeafLayerWrapper::LeafLayerWrapper(QJsonObject json, ElementManager* elementMana : LayerWrapper(json, parent, elementManager), wrappedElement(elementManager->getElementById(json.value("element").toInt())) { - styles = new LayerStyleContainer(LayerStyleContainer::fromJson( - wrappedElement->isClosed() ? ElementType::TYPE_CLOSED : ElementType::TYPE_UNCLOSED, - json.value("styles").toArray())); + if (typeid(*wrappedElement) == typeid(GroupElement)) + { + 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; if(wrappedElement != nullptr) wrappedElement->referencedCount++;