mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
added size contraints for zone view & scroll bars, fixing issue #34
This commit is contained in:
parent
c835a827b0
commit
40fbbc5982
4 changed files with 55 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include <math.h>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsSceneWheelEvent>
|
||||
#include "zoneviewzone.h"
|
||||
#include "player.h"
|
||||
#include "carddragitem.h"
|
||||
|
|
@ -82,6 +83,8 @@ void ZoneViewZone::reorganizeCards()
|
|||
cards[i]->setId(i);
|
||||
|
||||
int cols = floor(sqrt((double) cardCount / 2));
|
||||
if (cols > 7)
|
||||
cols = 7;
|
||||
int rows = ceil((double) cardCount / cols);
|
||||
if (rows < 1)
|
||||
rows = 1;
|
||||
|
|
@ -180,3 +183,8 @@ void ZoneViewZone::setWriteableRevealZone(bool _writeableRevealZone)
|
|||
writeableRevealZone = _writeableRevealZone;
|
||||
|
||||
}
|
||||
|
||||
void ZoneViewZone::wheelEvent(QGraphicsSceneWheelEvent *event)
|
||||
{
|
||||
emit wheelEventReceived(event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue