wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -1,19 +1,19 @@
|
|||
# layout.ludic - flex layout on the CSS box model, top-down: a box is told how wide it may be,
|
||||
# measures its content at that width (so a wrapping row knows how tall it is), then places each
|
||||
# child. A size is the border box: padding and border inside it, margin outside it.
|
||||
function ly_measure(ui_st: mut UiState, n: UiNode, avail: float, size: float, fg: int) -> void {
|
||||
function ly_measure(n: UiNode, avail: float, size: float, fg: int) -> void {
|
||||
n.rsize = size * zm_own(n)
|
||||
if n.size > 0.0 { n.rsize = n.size }
|
||||
n.rfg = fg
|
||||
n.rfg_a = ui_st.ly_fg_a
|
||||
n.rfg_a = ly_fg_a
|
||||
if n.fg != UI_INHERIT {
|
||||
n.rfg = n.fg
|
||||
n.rfg_a = n.fg_a
|
||||
}
|
||||
ui_st.ly_fg_a = n.rfg_a
|
||||
ly_fg_a = n.rfg_a
|
||||
n.mw = ly_hin(n)
|
||||
n.mh = ly_vin(n)
|
||||
if n.kind == UI_TEXT { ly_measure_text(ui_st, n, avail) }
|
||||
if n.kind == UI_TEXT { ly_measure_text(n, avail) }
|
||||
if n.kind == UI_NATIVE and n.native.measure != null {
|
||||
let base_w = n.mw
|
||||
let base_h = n.mh
|
||||
|
|
@ -33,7 +33,7 @@ function ly_measure(ui_st: mut UiState, n: UiNode, avail: float, size: float, fg
|
|||
var inner = avail - n.ml - n.mr
|
||||
if fixed_w >= 0.0 { inner = fixed_w }
|
||||
inner = ly_clamp(inner, n.min_w, n.max_w) - ly_hin(n)
|
||||
if n.dir == UI_ROW and n.wrap { ly_measure_wrap(ui_st, n, inner) } else { ly_measure_box(ui_st, n, inner) }
|
||||
if n.dir == UI_ROW and n.wrap { ly_measure_wrap(n, inner) } else { ly_measure_box(n, inner) }
|
||||
}
|
||||
n.content_h = n.mh
|
||||
if fixed_w >= 0.0 { n.mw = fixed_w }
|
||||
|
|
@ -43,6 +43,7 @@ function ly_measure(ui_st: mut UiState, n: UiNode, avail: float, size: float, fg
|
|||
n.mh = ly_clamp(n.mh, n.min_h, n.max_h)
|
||||
ly_min_note(n)
|
||||
}
|
||||
var ly_fg_a: float = 1.0
|
||||
function ly_hin(n: UiNode) -> float { return n.pl + n.pr + n.bl + n.br }
|
||||
function ly_vin(n: UiNode) -> float { return n.pt + n.pb + n.bt + n.bb }
|
||||
function ly_clamp(v: float, lo: float, hi: float) -> float {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue