src/ui/canvas.cpp

changeset 58
b7841cd31fb7
parent 57
5c0005f63319
child 61
4585d8d7a7ec
equal deleted inserted replaced
57:5c0005f63319 58:b7841cd31fb7
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())

mercurial