remove redundant clones, use mul_add on f32s
This commit is contained in:
parent
bd438a8581
commit
1d6a43486e
12 changed files with 69 additions and 69 deletions
|
|
@ -200,16 +200,16 @@ where
|
|||
|
||||
let (x, y) = axis.pack(main, pad.1);
|
||||
|
||||
let node_ = node.clone().move_to(Point::new(x, y));
|
||||
node.move_to_mut(Point::new(x, y));
|
||||
|
||||
let node_ = match axis {
|
||||
Axis::Horizontal => node_.align(Alignment::Start, align_items, Size::new(0.0, cross)),
|
||||
Axis::Vertical => node_.align(align_items, Alignment::Start, Size::new(cross, 0.0)),
|
||||
match axis {
|
||||
Axis::Horizontal => {
|
||||
node.align_mut(Alignment::Start, align_items, Size::new(0.0, cross))
|
||||
}
|
||||
Axis::Vertical => node.align_mut(align_items, Alignment::Start, Size::new(cross, 0.0)),
|
||||
};
|
||||
|
||||
let size = node_.bounds().size();
|
||||
|
||||
*node = node_;
|
||||
let size = node.bounds().size();
|
||||
|
||||
main += axis.main(size);
|
||||
}
|
||||
|
|
@ -367,16 +367,16 @@ pub fn resolve_wrapper<'a, Message>(
|
|||
|
||||
let (x, y) = axis.pack(main, pad.1);
|
||||
|
||||
let node_ = node.clone().move_to(Point::new(x, y));
|
||||
node.move_to_mut(Point::new(x, y));
|
||||
|
||||
let node_ = match axis {
|
||||
Axis::Horizontal => node_.align(Alignment::Start, align_items, Size::new(0.0, cross)),
|
||||
Axis::Vertical => node_.align(align_items, Alignment::Start, Size::new(cross, 0.0)),
|
||||
match axis {
|
||||
Axis::Horizontal => {
|
||||
node.align_mut(Alignment::Start, align_items, Size::new(0.0, cross))
|
||||
}
|
||||
Axis::Vertical => node.align_mut(align_items, Alignment::Start, Size::new(cross, 0.0)),
|
||||
};
|
||||
|
||||
let size = node_.bounds().size();
|
||||
|
||||
*node = node_;
|
||||
let size = node.bounds().size();
|
||||
|
||||
main += axis.main(size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ impl MenuState {
|
|||
let limits = Limits::new(Size::ZERO, self.menu_bounds.child_sizes[index]);
|
||||
let parent_offset = children_bounds.position() - Point::ORIGIN;
|
||||
let node = menu_tree.item.layout(tree, renderer, &limits);
|
||||
node.clone().move_to(Point::new(
|
||||
node.move_to(Point::new(
|
||||
parent_offset.x,
|
||||
parent_offset.y + position + self.scroll_offset,
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue