diff --git a/src/slic3r/GUI/CoordAxes.cpp b/src/slic3r/GUI/CoordAxes.cpp index 277c8ad300..fcb434f3b2 100644 --- a/src/slic3r/GUI/CoordAxes.cpp +++ b/src/slic3r/GUI/CoordAxes.cpp @@ -44,17 +44,23 @@ void CoordAxes::render(const Transform3d& trafo, float emission_factor) shader->start_using(); shader->set_uniform("emission_factor", emission_factor); + // Scale the axes if the camera is close to them to avoid issues + // such as https://github.com/prusa3d/PrusaSlicer/issues/9483 + const Camera& camera = wxGetApp().plater()->get_camera(); + Transform3d scale_tr = Transform3d::Identity(); + scale_tr.scale(std::min(1., camera.get_inv_zoom() * 10.)); + // x axis m_arrow.set_color(ColorRGBA::X()); - render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ 0.0, 0.5 * M_PI, 0.0 })); + render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ 0.0, 0.5 * M_PI, 0.0 }) * scale_tr); // y axis m_arrow.set_color(ColorRGBA::Y()); - render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ -0.5 * M_PI, 0.0, 0.0 })); + render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * Geometry::rotation_transform({ -0.5 * M_PI, 0.0, 0.0 }) * scale_tr); // z axis m_arrow.set_color(ColorRGBA::Z()); - render_axis(*shader, trafo * Geometry::translation_transform(m_origin)); + render_axis(*shader, trafo * Geometry::translation_transform(m_origin) * scale_tr); shader->stop_using(); if (curr_shader != nullptr)