84 this->gridMatrix = glm::rotate(this->gridMatrix, PI<float> / 2, glm::vec3{0, 1, 0}); |
84 this->gridMatrix = glm::rotate(this->gridMatrix, PI<float> / 2, glm::vec3{0, 1, 0}); |
85 } |
85 } |
86 this->updateGridMatrix(); |
86 this->updateGridMatrix(); |
87 this->update(); |
87 this->update(); |
88 } |
88 } |
89 Q_EMIT this->mouseMove(this); |
89 Q_EMIT this->mouseMove(this, event); |
90 PartRenderer::mouseMoveEvent(event); |
90 PartRenderer::mouseMoveEvent(event); |
|
91 this->update(); |
91 } |
92 } |
92 |
93 |
93 void Canvas::mousePressEvent(QMouseEvent* event) |
94 void Canvas::mousePressEvent(QMouseEvent* event) |
94 { |
95 { |
95 this->totalMouseMove = 0; |
96 this->totalMouseMove = 0; |
99 |
100 |
100 void Canvas::mouseReleaseEvent(QMouseEvent* event) |
101 void Canvas::mouseReleaseEvent(QMouseEvent* event) |
101 { |
102 { |
102 if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) |
103 if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) |
103 { |
104 { |
104 Q_EMIT this->mouseClick(this); |
105 Q_EMIT this->mouseClick(this, event); |
105 } |
106 } |
106 PartRenderer::mouseReleaseEvent(event); |
107 PartRenderer::mouseReleaseEvent(event); |
|
108 this->update(); |
107 } |
109 } |
108 |
110 |
109 void Canvas::initializeGL() |
111 void Canvas::initializeGL() |
110 { |
112 { |
111 // We first create the grid program and connect everything and only then call the part renderer's initialization |
113 // We first create the grid program and connect everything and only then call the part renderer's initialization |