╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1124 if (next == @as(usize, @intCast(cur))) return; │ │1125 root_focus.setFocus(keys[next]); │ │1126 if (box.children.values()[next].rect) |rect| scroll.scrollToRect(rect); │ │1127 -} │ │1128 - │ │1129 -// keep a scroll within its content, using the last build's grids. the scroll │ │1130 -// bar's reserved column/row isn't part of the content viewport, so exclude it │ │1131 -// (as scrollToRect does) or the last column/row stays unreachable. │ │1132 -pub fn clampScroll(sc: *wgt.Scroll(Widget)) void { │ │1133 - const vp = sc.grid orelse return; │ │1134 - const content = sc.child.box.grid orelse return; │ │1135 - const view_w = vp.size.width - sc.bar_w; │ │1136 - const view_h = vp.size.height - sc.bar_h; │ │1137 - const max_y: isize = if (content.size.height > view_h) @intCast(content.size.height - view_h) else 0;│ │1138 - const max_x: isize = if (content.size.width > view_w) @intCast(content.size.width - view_w) else 0; │ │1139 - sc.y = std.math.clamp(sc.y, 0, max_y); │ │1140 - sc.x = std.math.clamp(sc.x, 0, max_x); │ │1127 } │ │1128 │ │1129 pub const FlowBox = struct { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯