fix wrong id in scrollbar

This commit is contained in:
Alessandro Mauri 2025-10-28 22:00:29 +01:00
parent 8e39eee4af
commit 1905191453

View File

@ -155,7 +155,7 @@ fn Id? Ctx.div_end(&ctx)
elem.div.scroll_x.value = math::clamp(elem.div.scroll_x.value, 0.0f, 1.0f); elem.div.scroll_x.value = math::clamp(elem.div.scroll_x.value, 0.0f, 1.0f);
} }
} }
ctx.scrollbar(vsid_raw, &elem.div.scroll_x.value, max((float)bc.x / cbc.x, (float)0.15), false)!; ctx.scrollbar(hsid_raw, &elem.div.scroll_x.value, max((float)bc.x / cbc.x, (float)0.15), false)!;
elem.layout.scroll_offset.x = (short)(elem.div.scroll_x.value*(float)(elem.children_bounds.w-elem.bounds.w)); elem.layout.scroll_offset.x = (short)(elem.div.scroll_x.value*(float)(elem.children_bounds.w-elem.bounds.w));
} else { } else {
elem.div.scroll_x.value = 0; elem.div.scroll_x.value = 0;