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
2013-12-31 07:10:47 -07:00
parent c71eb041b6
commit 1302e65ee6
6 changed files with 18 additions and 5 deletions

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)