fix positioning in single line

This commit is contained in:
HJfod 2023-02-23 22:22:46 +02:00
parent 262c15dbb2
commit da815aba72

View file

@ -397,11 +397,11 @@ bool AxisLayout::canTryScalingDown(
if (prio > minMaxPrios.first) { if (prio > minMaxPrios.first) {
while (true) { while (true) {
prio -= 1; prio -= 1;
auto scale = this->maxScaleForPrio(nodes, prio); auto mscale = this->maxScaleForPrio(nodes, prio);
if (!scale) { if (!mscale) {
continue; continue;
} }
crossScaleDownFactor = scale; scale = mscale;
break; break;
} }
attemptRescale = true; attemptRescale = true;
@ -493,7 +493,7 @@ void AxisLayout::tryFitLayout(
return this->tryFitLayout( return this->tryFitLayout(
on, nodes, on, nodes,
minMaxPrios, doAutoScale, minMaxPrios, doAutoScale,
crossScaleDownFactor, squish, prio scale, squish, prio
); );
} }
} }
@ -632,7 +632,12 @@ void AxisLayout::tryFitLayout(
} }
else { else {
if (ix) { if (ix) {
rowAxisPos += this->nextGap(prev, opts) * row->scale * row->squish; if (row->prio == minMaxPrios.first) {
rowAxisPos += this->nextGap(prev, opts) * row->scale * row->squish;
}
else {
rowAxisPos += this->nextGap(prev, opts) * row->squish;
}
} }
axisPos = rowAxisPos + pos.axisLength * pos.axisAnchor; axisPos = rowAxisPos + pos.axisLength * pos.axisAnchor;
rowAxisPos += pos.axisLength - rowAxisPos += pos.axisLength -