matchEvent
Parameters
- self:*const HeaderResizeWidget
- *const HeaderResizeWidget
- e:*Event
- *Event
Source
Implementation
pub fn matchEvent(self: *const HeaderResizeWidget, e: *Event) bool {
var rs = self.data().rectScale();
// Clicking near the handle counts as clicking on the handle.
const grab_extra = self.init_opts.grab_tolerance * rs.s;
switch (self.direction) {
.vertical => {
rs.r.x -= grab_extra;
rs.r.w += grab_extra;
},
.horizontal => {
rs.r.y -= grab_extra;
rs.r.h += grab_extra;
},
}
return dvui.eventMatch(e, .{ .id = self.data().id, .r = rs.r });
}