From 55f37fd284b9aa9588c7fbc08e8f0b7518f70d05 Mon Sep 17 00:00:00 2001 From: ArgonarioD Date: Tue, 7 Feb 2023 16:14:56 +0800 Subject: [PATCH] =?UTF-8?q?FIX:=E7=A8=8B=E5=BA=8F=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Editor/GraphicElement.h | 4 ++++ .../src/Editor/LayerWrapper.h | 2 ++ .../src/Renderer/Preview/ElementRenderer.cpp | 12 +++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ArchitectureColoredPainting/src/Editor/GraphicElement.h b/ArchitectureColoredPainting/src/Editor/GraphicElement.h index 4228e52..edd0caf 100644 --- a/ArchitectureColoredPainting/src/Editor/GraphicElement.h +++ b/ArchitectureColoredPainting/src/Editor/GraphicElement.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "../Renderer/Painting/ElementStyle.h" @@ -49,6 +50,9 @@ public: //******************************** BitmapPath ********************************// +using std::vector; +using std::shared_ptr; + class BitmapPath { protected: diff --git a/ArchitectureColoredPainting/src/Editor/LayerWrapper.h b/ArchitectureColoredPainting/src/Editor/LayerWrapper.h index 456ac11..d063db9 100644 --- a/ArchitectureColoredPainting/src/Editor/LayerWrapper.h +++ b/ArchitectureColoredPainting/src/Editor/LayerWrapper.h @@ -12,6 +12,8 @@ #include #include #include + +#include "../Renderer/Painting/ElementStyle.h" using std::shared_ptr; using std::vector; class GraphicElement; diff --git a/ArchitectureColoredPainting/src/Renderer/Preview/ElementRenderer.cpp b/ArchitectureColoredPainting/src/Renderer/Preview/ElementRenderer.cpp index 2787c96..8c75783 100644 --- a/ArchitectureColoredPainting/src/Renderer/Preview/ElementRenderer.cpp +++ b/ArchitectureColoredPainting/src/Renderer/Preview/ElementRenderer.cpp @@ -43,11 +43,13 @@ std::vector generatePathBuffer(const QPainterPath& path) break; case QPainterPath::LineToElement: qDebug() << "LineToElement"; - glm::vec2 end = glm::vec2(element.x, element.y); - glm::vec2 mid = (pathBuffer.back() + end) / 2.f; - pathBuffer.push_back(mid); - pathBuffer.push_back(mid); - pathBuffer.push_back(end); + { + glm::vec2 end = glm::vec2(element.x, element.y); + glm::vec2 mid = (pathBuffer.back() + end) / 2.f; + pathBuffer.push_back(mid); + pathBuffer.push_back(mid); + pathBuffer.push_back(end); + } break; case QPainterPath::CurveToElement: qDebug() << "CurveToElement";