diff --git a/ArchitectureColoredPainting/EditorWidgetItem.ui b/ArchitectureColoredPainting/EditorWidgetItem.ui
index a02c38d..1ac2ea4 100644
--- a/ArchitectureColoredPainting/EditorWidgetItem.ui
+++ b/ArchitectureColoredPainting/EditorWidgetItem.ui
@@ -66,11 +66,11 @@
true
-
+
0
- 0
+ -17
1024
1024
@@ -89,34 +89,10 @@
- 10241024
- 10241024
+ 1024
+ 1024
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 1024
- 1024
-
-
-
-
- 1024
- 1024
-
-
-
-
-
diff --git a/ArchitectureColoredPainting/res/Shaders/painting.comp b/ArchitectureColoredPainting/res/Shaders/painting.comp
index d46c93d..2fc3e0a 100644
--- a/ArchitectureColoredPainting/res/Shaders/painting.comp
+++ b/ArchitectureColoredPainting/res/Shaders/painting.comp
@@ -1402,7 +1402,7 @@ void main()
if (elementZIndex <= zIndex)
{
uint transformIndex = leftChild - 0x80000000;
- uint elementIndex = bvhChildren[index].y - elementZIndex;
+ uint elementIndex = bvhChildren[index].y & 0x3FFFF;
mat3x2 transform = elementTranform[transformIndex];
vec2 localUV =
(mat3(vec3(transform[0], 0), vec3(transform[1], 0), vec3(transform[2], 1)) * vec3(uv, 1))
diff --git a/ArchitectureColoredPainting/src/Editor/util/PaintingUtil.cpp b/ArchitectureColoredPainting/src/Editor/util/PaintingUtil.cpp
index 0d17267..1aab871 100644
--- a/ArchitectureColoredPainting/src/Editor/util/PaintingUtil.cpp
+++ b/ArchitectureColoredPainting/src/Editor/util/PaintingUtil.cpp
@@ -91,7 +91,7 @@ void PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTransform transfo
QTransform trans;
double maxLen = std::max(bound.width(), bound.height()) * 1.00001;
//qDebug() << maxLen << bound;
- trans.scale(1 / maxLen, 1 / maxLen);
+ trans.scale(2 / maxLen, 2 / maxLen);
trans.translate(-bound.center().x(), -bound.center().y());
//std::shared_ptr keyLayerPtr(nowLayer);
@@ -116,6 +116,7 @@ void PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTransform transfo
for (auto& baseStyle : baseStyles) {
double lineWidth = 0;
+ QPainterPath path;
std::shared_ptr material;
@@ -124,15 +125,19 @@ void PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTransform transfo
std::static_pointer_cast(copy)->halfWidth /= maxLen;
lineWidth = std::static_pointer_cast(copy)->halfWidth;
material = copy;
+
+ QPainterPathStroker stroker;
+ stroker.setWidth(lineWidth * 2);
+ stroker.setCapStyle(Qt::RoundCap);
+ stroker.setJoinStyle(Qt::RoundJoin);
+ path = stroker.createStroke(painterPath);
}
else
+ {
material = baseStyle.material;
- QPainterPathStroker stroker;
- stroker.setWidth(lineWidth * 2);
- stroker.setCapStyle(Qt::RoundCap);
- stroker.setJoinStyle(Qt::RoundJoin);
- QPainterPath strokePath = stroker.createStroke(painterPath);
- auto rect = leafTransform.map(strokePath).boundingRect();
+ path = painterPath;
+ }
+ auto rect = leafTransform.map(path).boundingRect();
elementTransform.bound = glm::vec4(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
//qDebug() << elementTransform.bound.x << elementTransform.bound.y << elementTransform.bound.z << elementTransform.bound.z;
elementTransform.transform = glm::mat3x2(
diff --git a/ArchitectureColoredPainting/src/Renderer/Model.cpp b/ArchitectureColoredPainting/src/Renderer/Model.cpp
index ee5f5cc..48382cb 100644
--- a/ArchitectureColoredPainting/src/Renderer/Model.cpp
+++ b/ArchitectureColoredPainting/src/Renderer/Model.cpp
@@ -351,7 +351,7 @@ GLuint Renderer::Model::loadPainting(std::string path)
trans.m13(), trans.m23(), trans.m33()).c_str();
//painting.addElement(*element[0], ElementTransform{ glm::vec4(-1,-1,1,1), mat, 0});
- painting.addElement(*element[1], ElementTransform{ glm::vec4(-1,-1,0,1), mat, 0 });
+ painting.addElement(*element[1], ElementTransform{ glm::vec4(-1,-1,0,1), mat, 1 });
painting.addElement(*element[2], ElementTransform{ glm::vec4(0,-1,1,1), mat2, 0 });
//painting.addElement(*element[0], ElementTransform{ glm::vec2(-0.45,0.45), glm::vec2(0.25), 0, glm::bvec2(false), 0 });
//painting.addElement(*element[1], ElementTransform{ glm::vec2(-0.535,0.33), glm::vec2(0.15), 0, glm::bvec2(false), 0 });
diff --git a/svg/正方形.svg b/svg/正方形.svg
new file mode 100644
index 0000000..7d15a40
--- /dev/null
+++ b/svg/正方形.svg
@@ -0,0 +1 @@
+
\ No newline at end of file