Fix Overlay composition
Translations were not easily composable.
This commit is contained in:
parent
7dd32f3be4
commit
25006b9c6f
10 changed files with 70 additions and 26 deletions
|
|
@ -18,7 +18,7 @@ use crate::core::widget::tree::{self, Tree};
|
|||
use crate::core::widget::{self, Widget};
|
||||
use crate::core::Element;
|
||||
use crate::core::{
|
||||
self, Clipboard, Hasher, Length, Point, Rectangle, Shell, Size,
|
||||
self, Clipboard, Hasher, Length, Point, Rectangle, Shell, Size, Vector,
|
||||
};
|
||||
use crate::runtime::overlay::Nested;
|
||||
|
||||
|
|
@ -333,9 +333,10 @@ where
|
|||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
position: Point,
|
||||
translation: Vector,
|
||||
) -> layout::Node {
|
||||
self.with_overlay_maybe(|overlay| {
|
||||
overlay.layout(renderer, bounds, position)
|
||||
overlay.layout(renderer, bounds, position, translation)
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -577,9 +577,10 @@ where
|
|||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
position: Point,
|
||||
translation: Vector,
|
||||
) -> layout::Node {
|
||||
self.with_overlay_maybe(|overlay| {
|
||||
overlay.layout(renderer, bounds, position)
|
||||
overlay.layout(renderer, bounds, position, translation)
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ use crate::core::renderer;
|
|||
use crate::core::widget;
|
||||
use crate::core::widget::tree::{self, Tree};
|
||||
use crate::core::{
|
||||
self, Clipboard, Element, Length, Point, Rectangle, Shell, Size, Widget,
|
||||
self, Clipboard, Element, Length, Point, Rectangle, Shell, Size, Vector,
|
||||
Widget,
|
||||
};
|
||||
use crate::horizontal_space;
|
||||
use crate::runtime::overlay::Nested;
|
||||
|
|
@ -367,9 +368,10 @@ where
|
|||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
position: Point,
|
||||
translation: Vector,
|
||||
) -> layout::Node {
|
||||
self.with_overlay_maybe(|overlay| {
|
||||
overlay.layout(renderer, bounds, position)
|
||||
overlay.layout(renderer, bounds, position, translation)
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ where
|
|||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
position: Point,
|
||||
_translation: Vector,
|
||||
) -> layout::Node {
|
||||
let space_below = bounds.height - (position.y + self.target_height);
|
||||
let space_above = position.y;
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@ where
|
|||
renderer: &Renderer,
|
||||
bounds: Size,
|
||||
position: Point,
|
||||
_translation: Vector,
|
||||
) -> layout::Node {
|
||||
let viewport = Rectangle::with_size(bounds);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue