mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Fix issue with scaled displays
This commit is contained in:
@ -129,10 +129,14 @@ pub fn init(
|
|||||||
// Skip resize logic if percent is 50 (this is the default behavior)
|
// Skip resize logic if percent is 50 (this is the default behavior)
|
||||||
if (new_split.percent != 50) {
|
if (new_split.percent != 50) {
|
||||||
const allocation = sibling.size;
|
const allocation = sibling.size;
|
||||||
|
|
||||||
|
// get the content scale to handle scaled HiDPI displays
|
||||||
|
const scale = try sibling.getContentScale();
|
||||||
|
|
||||||
const split_percentage: f32 = @as(f32, @floatFromInt(new_split.percent)) / 100;
|
const split_percentage: f32 = @as(f32, @floatFromInt(new_split.percent)) / 100;
|
||||||
const total_surface_size: f32 = switch (self.orientation) {
|
const total_surface_size: f32 = switch (self.orientation) {
|
||||||
.horizontal => @floatFromInt(allocation.width),
|
.horizontal => @as(f32, @floatFromInt(allocation.width)) / scale.x,
|
||||||
.vertical => @floatFromInt(allocation.height),
|
.vertical => @as(f32, @floatFromInt(allocation.height)) / scale.y,
|
||||||
};
|
};
|
||||||
|
|
||||||
// percentage to apply based on direction
|
// percentage to apply based on direction
|
||||||
|
Reference in New Issue
Block a user