Skip to content
Snippets Groups Projects
Commit 4eacc4e6 authored by Finn Bear's avatar Finn Bear
Browse files

Show scale.

parent 16317799
No related branches found
No related tags found
No related merge requests found
......@@ -195,8 +195,8 @@ impl Slide for Fractals {
};
Frame::none().margin(Margin::same(20.0)).show(ui, |ui| {
fade_out(ui, all_fade_out_start, |ui| {
ui.vertical_centered(|ui| {
ui.vertical_centered(|ui| {
fade_out(ui, all_fade_out_start, |ui| {
ui.heading("Fractals");
let quote_fade_start = match &self.state {
FractalsState::Before | FractalsState::Grid { .. } | FractalsState::Erase { .. } | FractalsState::Axes { .. } | FractalsState::Rectangle { .. } | FractalsState::Circle { .. } => None,
......@@ -331,14 +331,23 @@ impl Slide for Fractals {
let screen = ui.ctx().input().screen_rect();
*zoom = 3.0 * 0.95f32.powf(time * 10.0).max(0.0001);
let lerp = (time * 1.0).sqrt().min(1.0);
let center = Pos2::new(ultimate.x * lerp, ultimate.y * lerp);
accelerator.run(
Pos2::new(ultimate.x * lerp, ultimate.y * lerp),
center,
*zoom,
image,
);
//println!("zoom: {}", *zoom);
egui::Image::new(&ui.ctx().load_texture("zoom", image.clone()), Vec2::ZERO)
.paint_at(ui, screen);
fade_in(ui, all_fade_out_start, |ui| {
ui.style_mut().visuals.widgets.noninteractive.fg_stroke.color = Color32::WHITE;
ui.add_space(ui.available_height() - 50.0);
ui.centered_and_justified(|ui| {
ui.label(format!("Center: ({:.5}, {:.5}), Scale: {:.5}", center.x, center.y, *zoom))
});
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment