mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix up for new zig
This commit is contained in:
@ -132,11 +132,11 @@ pub const Font = opaque {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn getUnitsPerEm(self: *Font) u32 {
|
pub fn getUnitsPerEm(self: *Font) u32 {
|
||||||
return c.CTFontGetUnitsPerEm(@ptrCast(c.CTFontRef, self));
|
return c.CTFontGetUnitsPerEm(@ptrCast(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getSize(self: *Font) f64 {
|
pub fn getSize(self: *Font) f64 {
|
||||||
return c.CTFontGetSize(@ptrCast(c.CTFontRef, self));
|
return c.CTFontGetSize(@ptrCast(self));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ pub const Face = struct {
|
|||||||
// TODO(mitchellh): color is going to require a depth here
|
// TODO(mitchellh): color is going to require a depth here
|
||||||
var buf = try alloc.alloc(u8, width * height);
|
var buf = try alloc.alloc(u8, width * height);
|
||||||
defer alloc.free(buf);
|
defer alloc.free(buf);
|
||||||
std.mem.set(u8, buf, 0);
|
@memset(buf, 0);
|
||||||
|
|
||||||
const space = try macos.graphics.ColorSpace.createDeviceGray();
|
const space = try macos.graphics.ColorSpace.createDeviceGray();
|
||||||
defer space.release();
|
defer space.release();
|
||||||
@ -166,8 +166,8 @@ pub const Face = struct {
|
|||||||
ctx.fillRect(.{
|
ctx.fillRect(.{
|
||||||
.origin = .{ .x = 0, .y = 0 },
|
.origin = .{ .x = 0, .y = 0 },
|
||||||
.size = .{
|
.size = .{
|
||||||
.width = @intToFloat(f64, width),
|
.width = @floatFromInt(width),
|
||||||
.height = @intToFloat(f64, height),
|
.height = @floatFromInt(height),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user