diff --git a/ArchitectureColoredPainting/src/Editor/LayerStyle.cpp b/ArchitectureColoredPainting/src/Editor/LayerStyle.cpp index 4d88518..e44e855 100644 --- a/ArchitectureColoredPainting/src/Editor/LayerStyle.cpp +++ b/ArchitectureColoredPainting/src/Editor/LayerStyle.cpp @@ -23,11 +23,6 @@ const std::vector() std::vector StrokeElementLayerStyle::toBaseStyles() const { std::vector baseStyles; - /*for (auto materialStyle : materialStyles) - { - baseStyles.push_back(Renderer::BaseStyle(std::make_shared(), - materialStyle)); - }*/ if (enableEachSideIndependent) { baseStyles.push_back(Renderer::BaseStyle(std::make_shared(), @@ -37,10 +32,10 @@ std::vector StrokeElementLayerStyle::toBaseStyles() const } else { - strokePair.first->strokeType = Renderer::StrokeType::kBothSides; - baseStyles.push_back(Renderer::BaseStyle(std::make_shared(), - strokePair.first)); - strokePair.first->strokeType = Renderer::StrokeType::kLeftSide; + auto material = std::shared_ptr(std::move(strokePair.first->clone())); + std::dynamic_pointer_cast(material)->strokeType = Renderer::StrokeType::kBothSides; + + baseStyles.push_back(Renderer::BaseStyle(std::make_shared(), material)); } return baseStyles; } @@ -104,31 +99,6 @@ QWidget* StrokeElementLayerStyle::getInputWidget() this->enableEachSideIndependent = toggled; rightStrokeView->setDisabled(!toggled); }); - //auto stroke = std::dynamic_pointer_cast(this->materialStyles[0]->materialStroke); - //QColor* color = &(stroke->materialMap[1.0].color); - /*auto stroke = std::dynamic_pointer_cast(this->materialStyles[0]->materialStroke); - QColor* color = &(stroke->material.color); - r->setText(QString::number(color->red())); - g->setText(QString::number(color->green())); - b->setText(QString::number(color->blue())); - QObject::connect(r, &QLineEdit::textChanged, [color](QString content) { - if (!content.isEmpty()) - { - color->setRed(content.toInt()); - } - }); - QObject::connect(g, &QLineEdit::textChanged, [color](QString content) { - if (!content.isEmpty()) - { - color->setGreen(content.toInt()); - } - }); - QObject::connect(b, &QLineEdit::textChanged, [color](QString content) { - if (!content.isEmpty()) - { - color->setBlue(content.toInt()); - } - });*/ return w; } diff --git a/ArchitectureColoredPainting/src/Editor/LayerStyle.h b/ArchitectureColoredPainting/src/Editor/LayerStyle.h index 3012ebe..7d5fb25 100644 --- a/ArchitectureColoredPainting/src/Editor/LayerStyle.h +++ b/ArchitectureColoredPainting/src/Editor/LayerStyle.h @@ -9,6 +9,7 @@ #include "../Renderer/Painting/MaterialStyleStroke.h" #include "../Renderer/Painting/MaterialStyleFill.h" +using Renderer::MaterialStyle; using Renderer::MaterialStyleStroke; /**