src/ui/canvas.cpp

changeset 108
94c92c923713
parent 107
02f142b399b1
child 109
40a1cf2f38f5
--- a/src/ui/canvas.cpp	Sat Jul 24 01:50:38 2021 +0300
+++ b/src/ui/canvas.cpp	Sun Jul 25 13:49:37 2021 +0300
@@ -77,6 +77,10 @@
 		this->updateGridMatrix();
 		this->update();
 	}
+	MouseMoveInfo info;
+	info.invoker = this;
+	info.worldPosition = this->worldPosition;
+	emit mouseMove(info);
 	PartRenderer::mouseMoveEvent(event);
 }
 
@@ -225,16 +229,27 @@
 			}
 			for (const PreviewLayer& previewLayer : this->previewLayers)
 			{
-				painter.setBrush({previewLayer.color});
-				for (const geom::NPolygon& polygon3d : previewLayer.polygons)
+				for (const PreviewLayer::Polygon& polygon3d : previewLayer.polygons)
 				{
+					painter.setBrush(polygon3d.brush);
+					painter.setPen(polygon3d.pen);
 					QVector<QPointF> points2d;
-					points2d.reserve(polygon3d.points.size());
-					for (const glm::vec3& point : polygon3d.points)
+					points2d.reserve(polygon3d.geometry.points.size());
+					for (const glm::vec3& point : polygon3d.geometry.points)
 					{
 						points2d.push_back(this->modelToScreenCoordinates(point));
 					}
-					painter.drawPolygon({points2d});
+					painter.drawPolygon(QPolygonF{points2d});
+				}
+				for (const PreviewLayer::Point& point : previewLayer.points)
+				{
+					const geom::CircleF circle = {
+						this->modelToScreenCoordinates(point.location),
+						5.0,
+					};
+					painter.setBrush(point.brush);
+					painter.setPen(point.pen);
+					painter.drawEllipse(geom::inscribe(circle));
 				}
 			}
 		}

mercurial