4 Commits
Author SHA1 Message Date
admin 877047c09d Merge pull request #2 from Alpaq92/ci
CI for both coordinate types; README fixes
2026-10-23 10:15:40 +02:00
Roman ChojnackiandClaude Opus 5.5 78b92fded8 README: wording, the build line links onlay.c, no ONLAY markers left
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 10:12:22 +02:00
Roman ChojnackiandClaude Opus 5.5 1c20828e69 CI: the tests in both coordinate types, on GCC, Clang and MSVC
Every job builds test_onlay.c with warnings as errors, once with float
coordinates and once with int16_t, and runs it. The test now uses snprintf
and casts what it passes as lay_scalar, which MSVC's /W4 asked for.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 10:11:52 +02:00
admin f2416fd056 Merge pull request #1 from Alpaq92/tidy
Comments only where the code cannot say it
2026-10-23 09:55:22 +02:00
+9 -8
View File
@@ -53,16 +53,14 @@ fraction.
**Gaps.** `lay_set_gap(ctx, item, n)` puts space between an item's children
without putting it outside them, so a row of three has two gaps and no leading
or trailing one. It applies down a wrapped row's lines as well as along them,
and it is counted when a container is sized to its contents — otherwise a
container came out exactly one gap per child too short.
and counts when a container is sized to its contents — otherwise a container
came out one gap per child too short.
**Padding**, from [randrew/layout#23](https://github.com/randrew/layout/pull/23)
by [codecat](https://github.com/codecat), ported onto the struct rect. A margin
is space outside an item and a padding is space inside it: a padding insets the
rect an item lays its children into, and is added when that item is sized to
its contents.
Every change is marked `// ONLAY:` in the source with the reason next to it.
rect an item lays its children into, and is added on both sides when that item
is sized to its contents.
## Tests
@@ -72,10 +70,13 @@ weighted columns, floors that grow, template rows, and padding against margin.
Upstream's own `test_layout.c` is not carried: it assumes the vector rect.
```
cc -DLAY_FLOAT=1 -o onlaytest test_onlay.c && ./onlaytest
cc -DLAY_FLOAT=1 -o onlaytest test_onlay.c onlay.c && ./onlaytest
```
## Licence
CI runs it with float and `int16_t` coordinates on GCC, Clang and MSVC, warnings
as errors.
## License
MIT, as upstream. See `LICENSE` — the original copyright is Andrew Richards's
and is unchanged.