mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
use a const scoped block for font size
This commit is contained in:
@ -1193,11 +1193,14 @@ pub fn scrollCallback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn contentScaleCallback(self: *Surface, content_scale: apprt.ContentScale) void {
|
pub fn contentScaleCallback(self: *Surface, content_scale: apprt.ContentScale) void {
|
||||||
var size = self.font_size;
|
|
||||||
const x_dpi = content_scale.x * font.face.default_dpi;
|
const x_dpi = content_scale.x * font.face.default_dpi;
|
||||||
const y_dpi = content_scale.y * font.face.default_dpi;
|
const y_dpi = content_scale.y * font.face.default_dpi;
|
||||||
size.xdpi = @intFromFloat(x_dpi);
|
const size = size: {
|
||||||
size.ydpi = @intFromFloat(y_dpi);
|
var size = self.font_size;
|
||||||
|
size.xdpi = @intFromFloat(x_dpi);
|
||||||
|
size.ydpi = @intFromFloat(y_dpi);
|
||||||
|
break :size size;
|
||||||
|
};
|
||||||
self.setFontSize(size);
|
self.setFontSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user