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) {
while (true) {
prio -= 1;
auto scale = this->maxScaleForPrio(nodes, prio);
if (!scale) {
auto mscale = this->maxScaleForPrio(nodes, prio);
if (!mscale) {
continue;
}
crossScaleDownFactor = scale;
scale = mscale;
break;
}
attemptRescale = true;
@ -493,7 +493,7 @@ void AxisLayout::tryFitLayout(
return this->tryFitLayout(
on, nodes,
minMaxPrios, doAutoScale,
crossScaleDownFactor, squish, prio
scale, squish, prio
);
}
}
@ -632,8 +632,13 @@ void AxisLayout::tryFitLayout(
}
else {
if (ix) {
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;
rowAxisPos += pos.axisLength -
row->axisEndsLength * row->scale * (1.f - row->squish) * 1.f / nodes->count();