基本稳定了strokeStyle的修改
parent
e97e6d5281
commit
0ff779c5b2
|
@ -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> baseStyles;
|
||||
/*for (auto materialStyle : materialStyles)
|
||||
{
|
||||
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(),
|
||||
materialStyle));
|
||||
}*/
|
||||
if (enableEachSideIndependent)
|
||||
{
|
||||
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(),
|
||||
|
@ -37,10 +32,10 @@ std::vector<Renderer::BaseStyle> StrokeElementLayerStyle::toBaseStyles() const
|
|||
}
|
||||
else
|
||||
{
|
||||
strokePair.first->strokeType = Renderer::StrokeType::kBothSides;
|
||||
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(),
|
||||
strokePair.first));
|
||||
strokePair.first->strokeType = Renderer::StrokeType::kLeftSide;
|
||||
auto material = std::shared_ptr<MaterialStyle>(std::move(strokePair.first->clone()));
|
||||
std::dynamic_pointer_cast<MaterialStyleStroke>(material)->strokeType = Renderer::StrokeType::kBothSides;
|
||||
|
||||
baseStyles.push_back(Renderer::BaseStyle(std::make_shared<Renderer::TransformStyle>(), material));
|
||||
}
|
||||
return baseStyles;
|
||||
}
|
||||
|
@ -104,31 +99,6 @@ QWidget* StrokeElementLayerStyle::getInputWidget()
|
|||
this->enableEachSideIndependent = 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "../Renderer/Painting/MaterialStyleStroke.h"
|
||||
#include "../Renderer/Painting/MaterialStyleFill.h"
|
||||
|
||||
using Renderer::MaterialStyle;
|
||||
using Renderer::MaterialStyleStroke;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue