Make Overlay aware of viewport
... and unify `Image::float` and `Image::translate`
This commit is contained in:
parent
a2a7c18c9d
commit
6c51a9579d
29 changed files with 121 additions and 56 deletions
|
|
@ -212,11 +212,9 @@ fn card<'a>(
|
|||
.scale(thumbnail.zoom.interpolate(1.0, 1.1, now))
|
||||
.translate(move |bounds, viewport| {
|
||||
let final_bounds = bounds.zoom(1.1);
|
||||
|
||||
final_bounds.offset(&viewport.shrink(10))
|
||||
* thumbnail.zoom.interpolate(0.0, 1.0, now)
|
||||
})
|
||||
.float(true)
|
||||
.style(move |_theme| image::Style {
|
||||
shadow: Shadow {
|
||||
color: Color::BLACK.scale_alpha(
|
||||
|
|
|
|||
|
|
@ -425,6 +425,7 @@ mod toast {
|
|||
state: &'b mut Tree,
|
||||
layout: Layout<'_>,
|
||||
renderer: &Renderer,
|
||||
viewport: &Rectangle,
|
||||
translation: Vector,
|
||||
) -> Option<overlay::Element<'b, Message, Theme, Renderer>> {
|
||||
let instants = state.state.downcast_mut::<Vec<Option<Instant>>>();
|
||||
|
|
@ -435,6 +436,7 @@ mod toast {
|
|||
&mut content_state[0],
|
||||
layout,
|
||||
renderer,
|
||||
viewport,
|
||||
translation,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue