From af931e65fc539bd449d8158d89877920b0a09792 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Tue, 10 Nov 2026 02:28:40 +0800 Subject: [PATCH] Fix plate offsets in the preview tool position readout (#17172) Fix preview tool position coordinates on additional plates --- src/slic3r/GUI/GCodeViewer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 017c88bb1c..8119a15dbe 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -780,9 +780,15 @@ void GCodeViewer::SequentialView::Marker::render_position_window(const libvgcode ImGui::BeginGroup(); // group contents to make information area more compact + // Preview vertices include the plate offset for rendering in scene coordinates. + // Show the position relative to the current plate instead. + auto pos = vertex.position; + const Vec3d plate_origin = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_origin(); + pos[0] -= static_cast(plate_origin.x()); + pos[1] -= static_cast(plate_origin.y()); + // ORCA Use colorized axis labels & reduce precision on large-scale prints, // show one more decimal when the G-code was exported with high precision - auto pos = vertex.position; int max_value = std::round(std::max(std::max(pos[0], pos[1]), pos[2])); auto precision = m_high_precision_gcode ? (max_value > 9999 ? "%.2f" : max_value > 999 ? "%.3f" : "%.4f") : (max_value > 9999 ? "%.1f" : max_value > 999 ? "%.2f" : "%.3f");