Keep the scroll target types and wheelScroll file-private

ScrollTarget and ScrollTargets are only named inside Element.zig; callers
switch on the result or call scrollBy through it. wheelScroll has one
caller, wheel, in the same file.
This commit is contained in:
Adrià Arrufat committed 2026-09-16 15:00:50 +02:00
1 parent 2cc537fc8c
commit c2e4d13730
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -325,7 +325,7 @@ pub fn wheel(frame: *Frame, target: *Element, x: f64, y: f64, delta_x: f64, delt
/// Each axis scrolls the nearest ancestor-or-self scroll container along it,
/// else the viewport. Relative deltas may land on different scrollers per
/// axis, unlike an absolute position.
pub fn wheelScroll(target: *Element, delta_x: i32, delta_y: i32, frame: *Frame) !void {
fn wheelScroll(target: *Element, delta_x: i32, delta_y: i32, frame: *Frame) !void {
const targets = target.scrollContainers(.{ .x = delta_x != 0, .y = delta_y != 0 }, frame);
// A zero delta resolves to .viewport and scrolls it by nothing.
try targets.x.scrollBy(delta_x, 0, frame);
+2 -2
View File
@@ -1611,7 +1611,7 @@ pub const ScrollAxes = struct { x: bool = false, y: bool = false };
/// What a scroll along one axis lands on. html and body scroll the viewport,
/// and so does a detached element.
pub const ScrollTarget = union(enum) {
const ScrollTarget = union(enum) {
viewport,
container: *Element,
@@ -1624,7 +1624,7 @@ pub const ScrollTarget = union(enum) {
}
};
pub const ScrollTargets = struct {
const ScrollTargets = struct {
x: ScrollTarget = .viewport,
y: ScrollTarget = .viewport,
};