1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +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) { if (!testOnly) {
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
const FlowLayoutItem &li = rows.at(i).last(); const FlowLayoutItem &li = rows.at(i).last();
int width = li.item->sizeHint().width() + li.pos.x(); int width = li.item->sizeHint().width() + li.pos.x()
int offset = (rect.width() - width) / 2; - effectiveRect.x();
int offset = (effectiveRect.width() - width) / 2;
int height = 0; int height = 0;
for (int j = 0; j < rows.at(i).size(); j++) for (int j = 0; j < rows.at(i).size(); j++)