FIX: [STUDIO-4284] not set max height of liveview window

Change-Id: Ie00e6c30d37b0a308123c5f425ebeaf961000da8
Jira: STUDIO-4284,STUDIO-4258
This commit is contained in:
chunmao.guo 2023-09-06 12:09:03 +08:00 committed by Lane.Wei
parent 280cad182b
commit 09ed7ac18e
1 changed files with 15 additions and 15 deletions

View File

@ -641,20 +641,20 @@ void wxMediaCtrl2::DoSetSize(int x, int y, int width, int height, int sizeFlags)
#else
wxMediaCtrl::DoSetSize(x, y, width, height, sizeFlags);
#endif
if (sizeFlags & wxSIZE_USE_EXISTING) return;
wxSize size = GetVideoSize();
if (size.GetWidth() <= 0)
size = wxSize{16, 9};
int maxHeight = (width * size.GetHeight() + size.GetHeight() - 1) / size.GetWidth();
if (maxHeight != GetMaxHeight()) {
// BOOST_LOG_TRIVIAL(info) << "wxMediaCtrl2::DoSetSize: width: " << width << ", height: " << height << ", maxHeight: " << maxHeight;
SetMaxSize({-1, maxHeight});
CallAfter([this] {
if (auto p = GetParent()) {
p->Layout();
p->Refresh();
}
});
}
//if (sizeFlags & wxSIZE_USE_EXISTING) return;
//wxSize size = GetVideoSize();
//if (size.GetWidth() <= 0)
// size = wxSize{16, 9};
//int maxHeight = (width * size.GetHeight() + size.GetHeight() - 1) / size.GetWidth();
//if (maxHeight != GetMaxHeight()) {
// // BOOST_LOG_TRIVIAL(info) << "wxMediaCtrl2::DoSetSize: width: " << width << ", height: " << height << ", maxHeight: " << maxHeight;
// SetMaxSize({-1, maxHeight});
// CallAfter([this] {
// if (auto p = GetParent()) {
// p->Layout();
// p->Refresh();
// }
// });
//}
}