Skip to content

Commit

Permalink
adapt mac's retina screen
Browse files Browse the repository at this point in the history
  • Loading branch information
zxc524580210 committed Mar 5, 2021
1 parent 48766cc commit d6f073c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/forms/window-agora-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,19 @@ void AgoraBasic::resizeEvent(QResizeEvent *event)
CreateDisplay();

if (isVisible() && display) {
#if _WIN32
QSize size = this->size();
obs_display_resize(display, size.width(), size.height());
#else
QSize size = this->size() * ui->preview->devicePixelRatioF();
if (m_lstRemoteVideoUids.size() >= 1) {

obs_display_resize(display, size.width()/ (m_lstRemoteVideoUids.size() + 1), size.height() / (m_lstRemoteVideoUids.size()));
}else
{
obs_display_resize(display, size.width(), size.height());
}
#endif
}

}
Expand All @@ -410,9 +421,11 @@ void AgoraBasic::CreateDisplay()
QWindow* window = ui->preview->windowHandle();
if (display)
return;

#if _WIN32
QSize size = this->size();

#else
QSize size = this->size() * ui->preview->devicePixelRatioF();
#endif
gs_init_data info = {};
info.cx = size.width();
info.cy = size.height();
Expand Down

0 comments on commit d6f073c

Please sign in to comment.