From fad8043f5e3ee9d5b0465d02239c18006d7c77e8 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Mon, 7 Jul 2025 09:12:20 +0800 Subject: [PATCH] FIX:Optimize display of ImageDPIFrame jira: STUDIO-12783 Change-Id: I65bb9f6d1f70f921717acdf1dd24ab1d6e936e80 (cherry picked from commit 83594b82e0a9917d9be3f8cc54c2aa14d0f6bc57) --- src/slic3r/GUI/ImageDPIFrame.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/slic3r/GUI/ImageDPIFrame.cpp b/src/slic3r/GUI/ImageDPIFrame.cpp index f1b07fd14d..b72a50f603 100644 --- a/src/slic3r/GUI/ImageDPIFrame.cpp +++ b/src/slic3r/GUI/ImageDPIFrame.cpp @@ -81,6 +81,23 @@ void ImageDPIFrame::on_timer(wxTimerEvent &event) Raise(); } m_timer_count++; + }else{ + wxPoint mouse_pos = wxGetMousePosition(); + wxRect window_rect = GetScreenRect(); + + wxPoint center(window_rect.x + window_rect.width / 2, window_rect.y + window_rect.height / 2); + int half_width = window_rect.width / 2; + int half_height = window_rect.height / 2; + wxRect expanded_rect( + center.x - half_width * 2, + center.y - half_height * 2, + window_rect.width * 2, + window_rect.height * 2 + ); + + if (!expanded_rect.Contains(mouse_pos)) { + on_hide(); + } } }