ludic.ui, compiler: a component's model is filled in place into an object its instance keeps (value_set_*); colours, border-images and a class screen's stub made once; object-fit into a kept list - benchmark 20 -> 10 KB a frame

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 00:17:47 +03:00
parent 08ac2f1125
commit 429eeb7754
15 changed files with 44939 additions and 44681 deletions

View file

@ -21,10 +21,18 @@ function el_url(s: string) -> string {
}
# border-image: url(chip.png) 14 / 12px - the source's corner size, then how wide they are drawn
function el_border_image(ui_st: mut UiState, n: UiNode, s: string) -> void {
var close = 0
while close < len(s) and s[close] != 41 { close += 1 }
n.bi_src = el_url_u(ui_st, s[0..Math.min(close + 1, len(s))])
let rest = mm_split(ui_st, s[Math.min(close + 1, len(s))..len(s)], 47)
let m = mm_of(ui_st)
var at = mm_find(m, MM_BIMG, s)
if at < 0 {
var close = 0
while close < len(s) and s[close] != 41 { close += 1 }
at = mm_add(m, MM_BIMG, s)
if at < 0 { return }
m.texts[at] = el_url(s[0..Math.min(close + 1, len(s))])
m.lists[at] = lss_split(s[Math.min(close + 1, len(s))..len(s)], 47)
}
n.bi_src = m.texts[at]
let rest = m.lists[at]
n.bi_slice = el_num(tw(ui_st, rest[0]))
n.bi_width = el_px(ui_st, n.bi_slice)
if len(rest) > 1 { n.bi_width = el_unit(ui_st, tw(ui_st, rest[1])) }