@n-uf/placement 26.12.4 → 26.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/stack.js +4 -3
- package/dist/stack.js.map +1 -1
- package/dist/tiling.js +1 -1
- package/dist/tiling.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ Versions are calendar versions, `YY.M.R` (year, month of the release, counter wi
|
|
|
5
5
|
|
|
6
6
|
Unreleased entries live in `changes/` until a release joins them.
|
|
7
7
|
|
|
8
|
+
## 26.12.6
|
|
9
|
+
|
|
10
|
+
No changes in `@n-uf/placement`. Released in step with `@n-uf/motion` and `@n-uf/docking`, which share the version.
|
|
11
|
+
|
|
12
|
+
## 26.12.5
|
|
13
|
+
|
|
14
|
+
- **Fixed:** growing back brings an item out of the » into a form too wide across. Giving way keeps an item's last
|
|
15
|
+
drawn form when it is wider than the stack's cross size (its `cross.min` over it) and its next form is the », but
|
|
16
|
+
growing back refused that form, so the item stayed in the » with room to spare. Growing back now refuses only a form
|
|
17
|
+
the way down would step out of across, so it is the exact reverse of giving way here too.
|
|
18
|
+
|
|
8
19
|
## 26.12.4
|
|
9
20
|
|
|
10
21
|
- **Changed (breaking):** a form pinned by adding 1000 to its rank moves that pin to `level` (`StackForm.level`, a
|
package/dist/stack.js
CHANGED
|
@@ -322,6 +322,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
322
322
|
if (f.wrap) return !formFitsCross(f, cross2);
|
|
323
323
|
return crossMin(f) > cross2 + EPS;
|
|
324
324
|
};
|
|
325
|
+
const stepsAcross = (i, cross2) => itemSteps(items[i]) && tooWide(i, cross2) && canStep(i) && !isMenu(items[i].forms[nextOffered(i)]);
|
|
325
326
|
if (seed) seed.need = minSumWith(false);
|
|
326
327
|
if (grow) {
|
|
327
328
|
const comesBefore = (a, b) => givesWayBefore(items, b, items[b].forms[at[b]], a, items[a].forms[at[a]]) < 0;
|
|
@@ -335,7 +336,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
335
336
|
const held = (s) => s.held ?? formStepGroup(forms(s)[s.from]) === formStepGroup(forms(s)[s.to]);
|
|
336
337
|
hold = group.every(held) && idx.some(holds);
|
|
337
338
|
for (const s of [...group].reverse()) at[index.get(s.id)] = s.from;
|
|
338
|
-
if (minSum() <= length + EPS && crossOf() === c0 && changed.every((j) => !
|
|
339
|
+
if (minSum() <= length + EPS && crossOf() === c0 && changed.every((j) => !stepsAcross(j, c0))) return true;
|
|
339
340
|
changed.forEach((i, k) => at[i] = was[k]);
|
|
340
341
|
return false;
|
|
341
342
|
};
|
|
@@ -359,7 +360,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
359
360
|
for (; ; ) {
|
|
360
361
|
if (stuck) break;
|
|
361
362
|
const c0 = crossOf();
|
|
362
|
-
const fitsWith = (changed) => minSum() <= length + EPS && crossOf() === c0 && changed.every((j) => !
|
|
363
|
+
const fitsWith = (changed) => minSum() <= length + EPS && crossOf() === c0 && changed.every((j) => !stepsAcross(j, c0));
|
|
363
364
|
const queue = idx.filter((i) => itemSteps(items[i]) && at[i] > start[i] && !withHistory.has(items[i].id)).sort((a, b) => comesBefore(a, b) ? -1 : 1);
|
|
364
365
|
const next = queue[0];
|
|
365
366
|
if (next === void 0) break;
|
|
@@ -401,7 +402,7 @@ function solve(input, previous, seed, grow = false) {
|
|
|
401
402
|
cross = crossOf();
|
|
402
403
|
let stepped = false;
|
|
403
404
|
for (const i of idx) {
|
|
404
|
-
if (
|
|
405
|
+
if (stepsAcross(i, cross)) {
|
|
405
406
|
step(i, nextOffered(i));
|
|
406
407
|
stepped = true;
|
|
407
408
|
}
|