fix up for new zig

This commit is contained in:
Mitchell Hashimoto
2023-06-30 13:53:05 -07:00
parent ef5d86ffb0
commit 45da58188c
2 changed files with 5 additions and 5 deletions

View File

@ -132,11 +132,11 @@ pub const Font = opaque {
}
pub fn getUnitsPerEm(self: *Font) u32 {
return c.CTFontGetUnitsPerEm(@ptrCast(c.CTFontRef, self));
return c.CTFontGetUnitsPerEm(@ptrCast(self));
}
pub fn getSize(self: *Font) f64 {
return c.CTFontGetSize(@ptrCast(c.CTFontRef, self));
return c.CTFontGetSize(@ptrCast(self));
}
};

View File

@ -144,7 +144,7 @@ pub const Face = struct {
// TODO(mitchellh): color is going to require a depth here
var buf = try alloc.alloc(u8, width * height);
defer alloc.free(buf);
std.mem.set(u8, buf, 0);
@memset(buf, 0);
const space = try macos.graphics.ColorSpace.createDeviceGray();
defer space.release();
@ -166,8 +166,8 @@ pub const Face = struct {
ctx.fillRect(.{
.origin = .{ .x = 0, .y = 0 },
.size = .{
.width = @intToFloat(f64, width),
.height = @intToFloat(f64, height),
.width = @floatFromInt(width),
.height = @floatFromInt(height),
},
});