1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Fixed layout centering

This commit is contained in:
Martin Tůma 2021-08-08 11:07:53 +02:00
parent 0b3e35db72
commit 82d2ac0871

View File

@ -147,8 +147,9 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
if (!testOnly) {
for (int i = 0; i < rows.size(); i++) {
const FlowLayoutItem &li = rows.at(i).last();
int width = li.item->sizeHint().width() + li.pos.x();
int offset = (rect.width() - width) / 2;
int width = li.item->sizeHint().width() + li.pos.x()
- effectiveRect.x();
int offset = (effectiveRect.width() - width) / 2;
int height = 0;
for (int j = 0; j < rows.at(i).size(); j++)