87 PartRenderer::mousePressEvent(event); |
87 PartRenderer::mousePressEvent(event); |
88 } |
88 } |
89 |
89 |
90 void Canvas::mouseReleaseEvent(QMouseEvent* event) |
90 void Canvas::mouseReleaseEvent(QMouseEvent* event) |
91 { |
91 { |
92 MouseClickInfo info; |
|
93 info.click = this->totalMouseMove < (2.0 / sqrt(2)) * 5.0; |
|
94 emit mouseClick(info); |
|
95 if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) |
92 if (this->totalMouseMove < (2.0 / sqrt(2)) * 5.0) |
96 { |
93 { |
97 if (this->highlighted == ldraw::NULL_ID) |
94 if (this->highlighted == ldraw::NULL_ID) |
98 { |
95 { |
99 this->selection = {}; |
96 this->selection = {}; |
103 this->selection = {this->highlighted}; |
100 this->selection = {this->highlighted}; |
104 } |
101 } |
105 this->compiler->setSelectedObjects(this->selection); |
102 this->compiler->setSelectedObjects(this->selection); |
106 emit selectionChanged(this->selection); |
103 emit selectionChanged(this->selection); |
107 this->update(); |
104 this->update(); |
|
105 MouseClickInfo info; |
|
106 info.worldPosition = this->worldPosition; |
|
107 info.invoker = this; |
|
108 emit mouseClick(info); |
108 } |
109 } |
109 PartRenderer::mouseReleaseEvent(event); |
110 PartRenderer::mouseReleaseEvent(event); |
110 } |
111 } |
111 |
112 |
112 void Canvas::initializeGL() |
113 void Canvas::initializeGL() |