Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
latidoremi committed Aug 6, 2023
1 parent fb7d900 commit 020b9e0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/native/menu/menu_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,13 @@ impl Aod {
}
}

/// Returns child position and offset position
fn resolve(&self, parent_bounds: Rectangle, children_size: Size, viewport_size: Size) -> (Point, Point) {
/// Returns child position and offset position
fn resolve(
&self,
parent_bounds: Rectangle,
children_size: Size,
viewport_size: Size,
) -> (Point, Point) {
let (x, ox) = Self::adaptive(
parent_bounds.x,
parent_bounds.width,
Expand Down Expand Up @@ -261,9 +266,9 @@ impl MenuBounds {

// calc offset bounds
let delta = children_position - offset_position;
let offset_size = if delta.x.abs() > delta.y.abs(){
let offset_size = if delta.x.abs() > delta.y.abs() {
Size::new(delta.x, children_size.height)
}else{
} else {
Size::new(children_size.width, delta.y)
};
let offset_bounds = Rectangle::new(offset_position, offset_size);
Expand Down

0 comments on commit 020b9e0

Please sign in to comment.