mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 20:00:42 +08:00
2D click and drag functions now like in perl side.
This commit is contained in:
parent
b88d36c391
commit
ef0f7bf7bb
@ -145,6 +145,14 @@ void Plate2D::clean_instance_thumbnails() {
|
|||||||
void Plate2D::mouse_drag(wxMouseEvent& e) {
|
void Plate2D::mouse_drag(wxMouseEvent& e) {
|
||||||
const auto& point {this->point_to_model_units(e.GetPosition())};
|
const auto& point {this->point_to_model_units(e.GetPosition())};
|
||||||
if (e.Dragging()) {
|
if (e.Dragging()) {
|
||||||
|
if (!this->drag_start_pos.IsFullySpecified()) return; // possible concurrency problems?
|
||||||
|
auto model_object = this->model->objects.at(this->drag_object.obj);
|
||||||
|
model_object->instances.at(this->drag_object.inst)->offset =
|
||||||
|
Slic3r::Pointf(
|
||||||
|
unscale(point.x - this->drag_start_pos.x),
|
||||||
|
unscale(point.y - this->drag_start_pos.y)
|
||||||
|
);
|
||||||
|
model_object->update_bounding_box();
|
||||||
this->Refresh();
|
this->Refresh();
|
||||||
} else {
|
} else {
|
||||||
auto cursor = wxSTANDARD_CURSOR;
|
auto cursor = wxSTANDARD_CURSOR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user