glfw: fix getWindowPos (#35)

This commit is contained in:
pfg 2021-10-19 18:01:17 -04:00 committed by GitHub
parent 37e3c492e8
commit e0b9f995af

View file

@ -366,8 +366,8 @@ pub inline fn setIcon(self: Window, allocator: *mem.Allocator, images: ?[]Image)
} }
const Pos = struct { const Pos = struct {
x: usize, x: isize,
y: usize, y: isize,
}; };
/// Retrieves the position of the content area of the specified window. /// Retrieves the position of the content area of the specified window.
@ -388,7 +388,7 @@ pub inline fn getPos(self: Window) Error!Pos {
var y: c_int = 0; var y: c_int = 0;
c.glfwGetWindowPos(self.handle, &x, &y); c.glfwGetWindowPos(self.handle, &x, &y);
try getError(); try getError();
return Pos{ .x = @intCast(usize, x), .y = @intCast(usize, y) }; return Pos{ .x = @intCast(isize, x), .y = @intCast(isize, y) };
} }
/// Sets the position of the content area of the specified window. /// Sets the position of the content area of the specified window.