forge
Explore
Log in

Don't you dare go Hollow

tile: Prepare for oscillating animations

Browse files at this commit

8bebd54c6d63e3e500399f9737a0906de30dfbbeIvan MolodetskikhParent: 1978e5b
src/layout/tile.rsmodified+4 -3
@@ -198,7 +198,8 @@ impl<W: LayoutElement> Tile<W> {
198198 .open_animation
199199 .as_ref()
200200 .map(|anim| anim.value())
201- .unwrap_or(1.);
201+ .unwrap_or(1.)
202+ .max(0.);
202203 Size::from(((f64::from(size.w) * v).round() as i32, size.h))
203204 }
204205
@@ -356,7 +357,7 @@ impl<W: LayoutElement> Tile<W> {
356357 renderer,
357358 scale.x as i32,
358359 &elements,
359- anim.value() as f32,
360+ anim.value().clamp(0., 1.) as f32,
360361 );
361362 self.window()
362363 .set_offscreen_element_id(Some(elem.id().clone()));
@@ -369,7 +370,7 @@ impl<W: LayoutElement> Tile<W> {
369370 RescaleRenderElement::from_element(
370371 elem,
371372 center.to_physical_precise_round(scale),
372- (anim.value() / 2. + 0.5).min(1.),
373+ (anim.value() / 2. + 0.5).max(0.),
373374 ),
374375 ))
375376 .into_iter()