formatting
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 13s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 13s
This commit is contained in:
@@ -288,12 +288,8 @@ pub fn App(comptime E: type) type {
|
||||
.x = px -| 1,
|
||||
.y = py -| 1,
|
||||
.kind = blk: {
|
||||
if (motion and button != Mouse.Button.none) {
|
||||
break :blk .drag;
|
||||
}
|
||||
if (motion and button == Mouse.Button.none) {
|
||||
break :blk .motion;
|
||||
}
|
||||
if (motion and button != Mouse.Button.none) break :blk .drag;
|
||||
if (motion and button == Mouse.Button.none) break :blk .motion;
|
||||
if (sequence[sequence.len - 1] == 'm') break :blk .release;
|
||||
break :blk .press;
|
||||
},
|
||||
|
||||
@@ -370,9 +370,8 @@ pub fn Input(Event: type, Queue: type) fn (meta.FieldEnum(Event)) type {
|
||||
const input_struct = struct {
|
||||
pub fn input_fn(accept_event: meta.FieldEnum(Event)) type {
|
||||
const event_type: enum { ascii, utf8 } = blk: { // check for type correctness and the associated type to use for the passed `accept_event`
|
||||
const t = @FieldType(Event, @tagName(accept_event));
|
||||
const err_msg = "Unexpected type for the associated input completion event to trigger. Only `[]u8` or `[]u21` are allowed.";
|
||||
switch (@typeInfo(t)) {
|
||||
switch (@typeInfo(@FieldType(Event, @tagName(accept_event)))) {
|
||||
.pointer => |pointer| {
|
||||
if (pointer.size != .slice) @compileError(err_msg);
|
||||
switch (@typeInfo(pointer.child)) {
|
||||
|
||||
Reference in New Issue
Block a user