diff --git a/ArchitectureColoredPainting/Shaders/element.comp b/ArchitectureColoredPainting/Shaders/element.comp index 7ccc0b6..67d2ca9 100644 --- a/ArchitectureColoredPainting/Shaders/element.comp +++ b/ArchitectureColoredPainting/Shaders/element.comp @@ -1033,8 +1033,9 @@ void main() if (lineType == 2 || intTest % 2 == int(lineType)) { hitElement = true; - elementColor = vec4(1, 1, 0, 1); - // drawLine(minDistance / strokeWidth, styleIndex, elementColor, metallicRoughness); + //elementColor = vec4(1, 1, 0, 1); + vec2 metallicRoughness; + drawLine(minDistance / strokeWidth, styleIndex, elementColor, metallicRoughness); } else if (p3Last == p[0]) hitElement = false; diff --git a/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp b/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp index ac3e2a5..ec42d82 100644 --- a/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp +++ b/ArchitectureColoredPainting/src/Editor/GraphicElement.cpp @@ -6,62 +6,62 @@ PixelPath SimpleElement::getPaintObject() const { PixelPath result; result.addPath(painterPath); - return result; + return result; } void SimpleElement::loadSvgFile(const QString& filePath) { // TODO 样式问题 - SvgFileLoader loader; - loader.loadSvgFile(filePath, painterPath); - qDebug() << "load svg file success "<sourceLayer = sourceLayer; + this->sourceLayer = sourceLayer; } -void GroupElement::setSourceLayer(FolderLayerWrapper *sourceLayer) +void GroupElement::setSourceLayer(FolderLayerWrapper* sourceLayer) { - this->sourceLayer = sourceLayer; + this->sourceLayer = sourceLayer; } PixelPath GroupElement::getPaintObject() const { - if (sourceLayer != nullptr) { - sourceLayer->refresh(); - return sourceLayer->getCache(); - } - else - return PixelPath(); + if (sourceLayer != nullptr) { + sourceLayer->refresh(); + return sourceLayer->getCache(); + } + else + return PixelPath(); } //TODO: apply styles and send back PixelPath SimpleElement::getPaintObject(std::vector styles) const { PixelPath result; - Renderer::ElementStyleStrokeDemo demo; - qDebug() << (renderer==nullptr)<<"------------"; - //auto [img, mov] = renderer->drawElement(painterPath,demo,1.0,false); - //qDebug() << img << " ------"; - //result.addImage(img, mov); - result.addPath(painterPath); + Renderer::ElementStyleStrokeDemo demo(2); + qDebug() << (renderer == nullptr) << "------------"; + auto [img, mov] = renderer->drawElement(painterPath, demo, 1.0, false); + //qDebug() << img << " ------"; + result.addImage(img, mov); + //result.addPath(painterPath); // QImage img(80,80,QImage::Format_ARGB32); // QPainter pt(&img); //pt.setPen(QPen(Qt::red, 2)); //pt.drawLine(0, 0, 80, 80); //pt.end(); //result.addImage(img, QPoint(0, 0)); - return result; + return result; } PixelPath GroupElement::getPaintObject(std::vector styles) const { - return getPaintObject(); + return getPaintObject(); } //BitmapPath::BitmapPath() { diff --git a/ArchitectureColoredPainting/src/main.cpp b/ArchitectureColoredPainting/src/main.cpp index 7758559..ec0d673 100644 --- a/ArchitectureColoredPainting/src/main.cpp +++ b/ArchitectureColoredPainting/src/main.cpp @@ -1,11 +1,8 @@ #include "MainWindow.h" -#include "Renderer/Painting/CubicBezier.h" #include #include #include -using Renderer::CubicBezier; - extern "C" { _declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; @@ -20,7 +17,7 @@ int main(int argc, char* argv[]) //QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication a(argc, argv); - FramelessHelper::Core::setApplicationOSThemeAware(); + //FramelessHelper::Core::setApplicationOSThemeAware(); FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur); FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow); FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);