From a0d45085dddbf4a443eeb9bb2f3ac4d770032b2b Mon Sep 17 00:00:00 2001 From: karlis <2995621482@qq.com> Date: Mon, 27 Mar 2023 15:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=95=E7=94=A8Element?= =?UTF-8?q?=E7=9A=84Layer=E7=9A=84styles=E7=B1=BB=E5=9E=8B=E4=B8=BAALL=20|?= =?UTF-8?q?=20#32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Editor/LayerWrapper.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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++;