DVUI

Parameters

#
self:*ScrollContainerWidget
*ScrollContainerWidget
e:*Event
*Event

Source

Implementation

#
pub fn processEvent(self: *ScrollContainerWidget, e: *Event) void {
    switch (e.evt) {
        .mouse => |me| {
            if (me.action == .press and me.button.touch()) {
                // stop any current scrolling
                if (self.si.velocity.x != 0 or self.si.velocity.y != 0) {
                    // if we were scrolling, then eat the finger press so it
                    // doesn't do anything other than stop the scroll
                    e.handle(@src(), self.data());

                    self.si.velocity.x = 0;
                    self.si.velocity.y = 0;
                }
            }
        },
        else => {},
    }
}