From 9da629003acdeb9b37e0af96b7f4f43c425c1fd1 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Fri, 21 Jul 2023 10:39:42 +0800 Subject: [PATCH] FIX: the position of wipe tower is not correct when switch printer Change-Id: Ia3195834c13f4341d6a020afe52e22370385eaee --- src/slic3r/GUI/GLCanvas3D.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4fd8f15e4..0edd60f95 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2634,7 +2634,13 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re const float margin = 15.f; BoundingBoxf3 plate_bbox = wxGetApp().plater()->get_partplate_list().get_plate(plate_id)->get_bounding_box(); + coordf_t plate_bbox_x_max_local_coord = plate_bbox.max(0) - plate_origin(0); coordf_t plate_bbox_y_max_local_coord = plate_bbox.max(1) - plate_origin(1); + if (x + margin + wipe_tower_size(0) > plate_bbox_x_max_local_coord) { + x = plate_bbox_x_max_local_coord - wipe_tower_size(0) - margin; + ConfigOptionFloat wt_x_opt(x); + dynamic_cast(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, plate_id, 0); + } if (y + margin + wipe_tower_size(1) > plate_bbox_y_max_local_coord) { y = plate_bbox_y_max_local_coord - wipe_tower_size(1) - margin; ConfigOptionFloat wt_y_opt(y);