ludic.ui, ludic.i18n: frame_allocs to 0 - a wrap, an ellipsis, a tooltip's lines, a text-shadow's colour and a range's value kept by what made them; pointer events from a ring; inline text joined through the memo; the pool's and the state's lists through ui_kept; parse, memo miss, pool miss, lazy start and template errors declared; the translation cache clears in place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
629579123a
commit
429e419327
71 changed files with 365 additions and 155 deletions
|
|
@ -38,6 +38,7 @@ function el_dim(ui_st: mut UiState, n: UiNode, wide: bool, v: Val) -> void {
|
|||
# a length out of calc(); a percentage has nothing to be a share of here
|
||||
function el_calc_len(ui_st: mut UiState, s: string) -> float {
|
||||
if not ca_eval(ui_st, s) { return 0.0 }
|
||||
@alloc_ok("only when a template is wrong: a broken screen, never a working one")
|
||||
if ui_st.ca_pct != 0.0 { ui_err(ui_st, `{ui_st.el_key}: {s} - a percentage in calc() is for a width or a height`) }
|
||||
return ui_st.ca_px
|
||||
}
|
||||
|
|
@ -53,6 +54,7 @@ function el_flex_short(ui_st: mut UiState, n: UiNode, s: string) -> void {
|
|||
if len(parts) > 1 and len(parts[1]) > 0 and parts[1][0] >= 48 and parts[1][0] <= 57 { nx(n).shrink = el_num(parts[1]) }
|
||||
}
|
||||
# words apart by spaces, a bracket's own spaces kept: "calc(1em + 2px) 4px" is two
|
||||
@alloc_ok("a memo miss (mm_split): once per text")
|
||||
function el_words(s: string) -> []string {
|
||||
let out = new []string
|
||||
var at = 0
|
||||
|
|
@ -76,17 +78,16 @@ function el_text_shadow(ui_st: mut UiState, n: UiNode, s: string) -> void {
|
|||
if tw(ui_st, s) == "none" { return }
|
||||
let parts = mm_words(ui_st, s)
|
||||
var nums = 0
|
||||
var col = ""
|
||||
var from = -1
|
||||
for i in 0 .. len(parts) {
|
||||
let p = parts[i]
|
||||
if col == "" and ((p[0] >= 48 and p[0] <= 57) or p[0] == 45 or p[0] == 46) {
|
||||
if from < 0 and ((p[0] >= 48 and p[0] <= 57) or p[0] == 45 or p[0] == 46) {
|
||||
if nums == 0 { x.tsh_x = el_unit(ui_st, p) }
|
||||
if nums == 1 { x.tsh_y = el_unit(ui_st, p) }
|
||||
nums += 1
|
||||
} else if col == "" { col = p } else { col = col + " " + p }
|
||||
} else if from < 0 { from = i }
|
||||
}
|
||||
if col == "" { col = "rgba(0,0,0,0.6)" }
|
||||
x.tsh_c = ui_color(ui_st, col)
|
||||
x.tsh_c = ui_color(ui_st, el_tsh_col(ui_st, s, parts, from))
|
||||
x.tsh_a = ui_st.cl_alpha
|
||||
}
|
||||
# one word of a list of lengths (padding: calc(1em / 4) 2px)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue