Merge branch 'intuitive-pane-grid-resize' into feature/pane-grid-titlebar

This commit is contained in:
Héctor Ramón Jiménez 2020-06-08 18:33:36 +02:00
commit 8493ccec7f
8 changed files with 225 additions and 168 deletions

View file

@ -53,6 +53,30 @@ impl Axis {
}
}
}
pub(super) fn split_line_bounds(
&self,
rectangle: Rectangle,
ratio: f32,
spacing: f32,
) -> Rectangle {
match self {
Axis::Horizontal => Rectangle {
x: rectangle.x,
y: (rectangle.y + rectangle.height * ratio - spacing / 2.0)
.round(),
width: rectangle.width,
height: spacing,
},
Axis::Vertical => Rectangle {
x: (rectangle.x + rectangle.width * ratio - spacing / 2.0)
.round(),
y: rectangle.y,
width: spacing,
height: rectangle.height,
},
}
}
}
#[cfg(test)]