From cc33bb90ca4d2b933bc46c971dc58e9818de7da8 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 6 Jun 2023 15:43:42 +0800 Subject: [PATCH] FIX:update_target() in get_target() Resolve the issue of camera rotation and translation, which cause a change in perspective Change-Id: I2a8b8bcb7449082869206a7beada22e9029f4959 (cherry picked from commit baf2d7184c6bc8789d02aff1897c3e989f9ce03f) --- src/slic3r/GUI/Camera.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Camera.hpp b/src/slic3r/GUI/Camera.hpp index 54c6972f0..401365ad4 100644 --- a/src/slic3r/GUI/Camera.hpp +++ b/src/slic3r/GUI/Camera.hpp @@ -69,10 +69,12 @@ public: void enable_update_config_on_type_change(bool enable) { m_update_config_on_type_change_enabled = enable; } void translate(const Vec3d& displacement); - const Vec3d& get_target() const { return m_target; } + const Vec3d& get_target() { + update_target(); + return m_target; } void set_target(const Vec3d& target); - double get_distance() const { return (get_position() - m_target).norm(); } + double get_distance() { return (get_position() - get_target()).norm(); } double get_gui_scale() const { return m_gui_scale; } float get_zenit() const { return m_zenit; }