FIX:Optimize display of ImageDPIFrame

jira: STUDIO-12783
Change-Id: I65bb9f6d1f70f921717acdf1dd24ab1d6e936e80
(cherry picked from commit 83594b82e0a9917d9be3f8cc54c2aa14d0f6bc57)
This commit is contained in:
zhou.xu 2025-07-07 09:12:20 +08:00 committed by Noisyfox
parent 12725f763c
commit fad8043f5e

View file

@ -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();
}
}
}