Merge branch 'intuitive-pane-grid-resize' into feature/pane-grid-titlebar
This commit is contained in:
commit
8493ccec7f
8 changed files with 225 additions and 168 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue