mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +00:00
修复屏幕比例失真的问题
This commit is contained in:
parent
1292950aae
commit
7016d92bf8
3 changed files with 7 additions and 1 deletions
|
@ -130,6 +130,7 @@ void Device::initSignals()
|
|||
// update ui
|
||||
if (m_videoForm) {
|
||||
m_videoForm->setWindowTitle(deviceName);
|
||||
m_videoForm->updateScreenRatio(size);
|
||||
m_videoForm->updateShowSize(size);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,11 +112,15 @@ void VideoForm::updateStyleSheet(bool vertical)
|
|||
}
|
||||
}
|
||||
|
||||
void VideoForm::updateScreenRatio(const QSize &newSize)
|
||||
{
|
||||
m_widthHeightRatio = 1.0f * qMin(newSize.width(),newSize.height()) / qMax(newSize.width(),newSize.height());
|
||||
}
|
||||
|
||||
void VideoForm::updateShowSize(const QSize &newSize)
|
||||
{
|
||||
if (frameSize != newSize) {
|
||||
frameSize = newSize;
|
||||
|
||||
bool vertical = newSize.height() > newSize.width();
|
||||
QSize showSize = newSize;
|
||||
QDesktopWidget* desktop = QApplication::desktop();
|
||||
|
|
|
@ -21,6 +21,7 @@ public:
|
|||
|
||||
void switchFullScreen();
|
||||
void staysOnTop(bool top = true);
|
||||
void updateScreenRatio(const QSize &newSize);
|
||||
void updateShowSize(const QSize &newSize);
|
||||
void updateRender(const AVFrame *frame);
|
||||
void setController(Controller *controller);
|
||||
|
|
Loading…
Add table
Reference in a new issue