2D click and drag functions now like in perl side.

This commit is contained in:
Joseph Lenox 2018-05-12 13:39:20 -05:00
parent b88d36c391
commit ef0f7bf7bb

View File

@ -145,6 +145,14 @@ void Plate2D::clean_instance_thumbnails() {
void Plate2D::mouse_drag(wxMouseEvent& e) {
const auto& point {this->point_to_model_units(e.GetPosition())};
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();
} else {
auto cursor = wxSTANDARD_CURSOR;