25 { |
25 { |
26 const ldraw::Id id = this->pick(event->pos()); |
26 const ldraw::Id id = this->pick(event->pos()); |
27 this->highlighted = id; |
27 this->highlighted = id; |
28 this->totalMouseMove += (event->pos() - this->lastMousePosition).manhattanLength(); |
28 this->totalMouseMove += (event->pos() - this->lastMousePosition).manhattanLength(); |
29 this->lastMousePosition = event->pos(); |
29 this->lastMousePosition = event->pos(); |
30 this->worldPosition = this->screenToModelCoordinates(this->lastMousePosition); |
30 this->worldPosition = this->screenToModelCoordinates(this->lastMousePosition, geom::XY); |
31 if (this->worldPosition.has_value()) |
31 if (this->worldPosition.has_value()) |
32 { |
32 { |
33 this->worldPosition = glm::round(*this->worldPosition); |
33 this->worldPosition = glm::round(*this->worldPosition); |
34 } |
34 } |
35 if (this->worldPosition.has_value()) |
35 if (this->worldPosition.has_value()) |