create a sizing callback for the preview panel specifically, apparently on macos the window size isn't guaranteed to be the size it's set to in the main window size handler

This commit is contained in:
jp9000 committed 2013-12-31 07:10:47 -07:00
1 parent c71eb041b6
commit 1302e65ee6
6 files changed
+18 -5

No files matched your search

+12 -3
View File
@@ -185,11 +185,20 @@ void OBSBasic::OnSize(wxSizeEvent &event)
return;
ResizePreview(ovi.base_width, ovi.base_height);
}
void OBSBasic::OnResizePreview(wxSizeEvent &event)
{
event.Skip();
wxSize newSize = previewPanel->GetMinSize();
gs_entercontext(obs_graphics());
gs_resize(newSize.x, newSize.y);
gs_leavecontext();
graphics_t graphics = obs_graphics();
if (graphics) {
gs_entercontext(graphics);
gs_resize(newSize.x, newSize.y);
gs_leavecontext();
}
}
void OBSBasic::fileNewClicked(wxCommandEvent &event)