mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
fixed player area layout
This commit is contained in:
parent
7bff204461
commit
2451c39ef2
7 changed files with 41 additions and 27 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "zoneviewwidget.h"
|
||||
#include "zoneviewzone.h"
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
|
||||
GameScene::GameScene(QObject *parent)
|
||||
: QGraphicsScene(parent)
|
||||
|
|
@ -131,10 +132,10 @@ void GameScene::processViewSizeChange(const QSize &newSize)
|
|||
qreal minRatio = minWidth / sceneRect().height();
|
||||
if (minRatio > newRatio) {
|
||||
// Aspect ratio is dominated by table width.
|
||||
setSceneRect(sceneRect().x(), sceneRect().y(), minWidth, sceneRect().height());
|
||||
setSceneRect(0, 0, minWidth, sceneRect().height());
|
||||
} else {
|
||||
// Aspect ratio is dominated by window dimensions.
|
||||
setSceneRect(sceneRect().x(), sceneRect().y(), newRatio * sceneRect().height(), sceneRect().height());
|
||||
setSceneRect(0, 0, newRatio * sceneRect().height(), sceneRect().height());
|
||||
}
|
||||
|
||||
for (int i = 0; i < players.size(); ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue