基本稳定了strokeStyle的修改

dev-LayerStyle
ArgonarioD 2023-03-14 22:46:54 +08:00
parent e97e6d5281
commit 0ff779c5b2
2 changed files with 5 additions and 34 deletions

View File

@ -23,11 +23,6 @@ const std::vector<std::pair<QString, std::function<std::unique_ptr<LayerStyle>()
std::vector<Renderer::BaseStyle> StrokeElementLayerStyle::toBaseStyles() const std::vector<Renderer::BaseStyle> StrokeElementLayerStyle::toBaseStyles() const
{ {
std::vector<Renderer::BaseStyle> baseStyles; std::vector<Renderer::BaseStyle> baseStyles;
/*for (auto materialStyle : materialStyles)
{
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(),
materialStyle));
}*/
if (enableEachSideIndependent) if (enableEachSideIndependent)
{ {
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(), baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(),
@ -37,10 +32,10 @@ std::vector<Renderer::BaseStyle> StrokeElementLayerStyle::toBaseStyles() const
} }
else else
{ {
strokePair.first->strokeType = Renderer::StrokeType::kBothSides; auto material = std::shared_ptr<MaterialStyle>(std::move(strokePair.first->clone()));
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(), std::dynamic_pointer_cast<MaterialStyleStroke>(material)->strokeType = Renderer::StrokeType::kBothSides;
strokePair.first));
strokePair.first->strokeType = Renderer::StrokeType::kLeftSide; baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(), material));
} }
return baseStyles; return baseStyles;
} }
@ -104,31 +99,6 @@ QWidget* StrokeElementLayerStyle::getInputWidget()
this->enableEachSideIndependent = toggled; this->enableEachSideIndependent = toggled;
rightStrokeView->setDisabled(!toggled); rightStrokeView->setDisabled(!toggled);
}); });
//auto stroke = std::dynamic_pointer_cast<Renderer::StrokeRadialGradient>(this->materialStyles[0]->materialStroke);
//QColor* color = &(stroke->materialMap[1.0].color);
/*auto stroke = std::dynamic_pointer_cast<Renderer::StrokePlain>(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; return w;
} }

View File

@ -9,6 +9,7 @@
#include "../Renderer/Painting/MaterialStyleStroke.h" #include "../Renderer/Painting/MaterialStyleStroke.h"
#include "../Renderer/Painting/MaterialStyleFill.h" #include "../Renderer/Painting/MaterialStyleFill.h"
using Renderer::MaterialStyle;
using Renderer::MaterialStyleStroke; using Renderer::MaterialStyleStroke;
/** /**