Compare commits
2 Commits
e193109570
...
14e0a6ad0a
| Author | SHA1 | Date | |
|---|---|---|---|
| 14e0a6ad0a | |||
| bafadae1e0 |
@ -96,8 +96,7 @@ fn void Cache.remove(&cache, Key id)
|
||||
/* If there is no free space left then just return the first position */
|
||||
fn usz Cache.get_free_spot(&cache)
|
||||
{
|
||||
// TODO: in the upgrade to c3 1.7.5 use @bitsof()
|
||||
const BITS = $typeof(cache.present.data[0]).sizeof*8;
|
||||
const BITS = @bitsizeof(cache.present.data[0]);
|
||||
foreach (idx, d: cache.present.data) {
|
||||
if (d != $typeof(d).max) {
|
||||
usz spot = idx*BITS + BITS-d.clz();
|
||||
|
||||
@ -214,4 +214,3 @@ fn void? Ctx.push_update_atlas(&ctx, Atlas* atlas)
|
||||
}
|
||||
|
||||
macro Ctx.dbg_rect(&ctx, Rect r, uint c = 0xff000042u) => ctx.push_rect(r, int.max, &&(Style){.bg=c.to_rgba()})!!;
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ fn void resolve_grow_elements(Elem* e, Elem* p)
|
||||
p.layout.grow_children--;
|
||||
p.layout.occupied += slot;
|
||||
} else if (p.layout.dir == COLUMN) { // grow across the layout axis, inherit width of the parent
|
||||
e.bounds.w = p.content_space().x;
|
||||
e.bounds.w = p.content_space().x + p.layout.scroll_offset.x;
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ fn void resolve_grow_elements(Elem* e, Elem* p)
|
||||
p.layout.grow_children--;
|
||||
p.layout.occupied += slot;
|
||||
} else if (p.layout.dir == ROW) { // grow across the layout axis, inherit width of the parent
|
||||
e.bounds.h = p.content_space().y;
|
||||
e.bounds.h = p.content_space().y + p.layout.scroll_offset.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,7 +308,6 @@ fn void? Ctx.layout_string(&ctx, String text, Rect bounds, Anchor anchor, int z_
|
||||
{
|
||||
if (text == "") return;
|
||||
if (bounds.w <= 0 || bounds.h <= 0) return;
|
||||
ctx.push_scissor(bounds, z_index)!;
|
||||
|
||||
Font* font = &ctx.font;
|
||||
Id texture_id = font.id;
|
||||
@ -320,9 +319,6 @@ fn void? Ctx.layout_string(&ctx, String text, Rect bounds, Anchor anchor, int z_
|
||||
Rect uv = gi.gp.uv();
|
||||
ctx.push_sprite(b, uv, texture_id, z_index, hue)!;
|
||||
}
|
||||
|
||||
ctx.reset_scissor(z_index)!;
|
||||
// ctx.dbg_rect(str_bounds.off(bounds.position()));
|
||||
}
|
||||
|
||||
|
||||
@ -584,5 +580,3 @@ fn TextSize? Ctx.measure_string(&ctx, String text)
|
||||
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -124,8 +124,9 @@ fn void? Ctx.div_begin_id(&ctx,
|
||||
ctx.push_rect(elem.bounds.pad(style.margin), elem.z_index, style)!;
|
||||
|
||||
// update the ctx scissor, it HAS to be after drawing the background
|
||||
ctx.div_scissor = elem.bounds.pad(elem.layout.content_offset).max({0,0,0,0});
|
||||
ctx.push_scissor(ctx.div_scissor, elem.z_index)!;
|
||||
Rect scissor = elem.bounds.pad(elem.layout.content_offset).max({0,0,0,0});
|
||||
ctx.push_scissor(scissor, elem.z_index)!;
|
||||
ctx.div_scissor = scissor;
|
||||
|
||||
//elem.events = ctx.get_elem_events(elem);
|
||||
|
||||
@ -234,7 +235,6 @@ fn Id? Ctx.div_end(&ctx)
|
||||
elem.div.resized.y = true;
|
||||
elem.div.resize_size.y = content_bounds.h - (elem.bounds.y - m.y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// the active_div returns to the parent of the current one
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user