rae 0.1.10

Renderer-neutral widget, layout, sanitization, and GLSL shader primitives for Rust desktop tools.
Documentation
use rae::{MorphCacheKey, MorphProfile, MorphShape, Vec2};

fn main() {
    let transitions = [
        (MorphShape::RoundedCard, MorphShape::Blob),
        (MorphShape::Capsule, MorphShape::Ticket),
        (MorphShape::DockIsland, MorphShape::CommandLens),
        (MorphShape::NotchedPanel, MorphShape::RoundedCard),
    ];

    for (from, to) in transitions {
        let profile = MorphProfile::material_default(from, to);
        println!("\n{from:?} -> {to:?}");

        for elapsed_ms in [0, 120, 260, 420, 520, 680] {
            let state = profile.sample(elapsed_ms);
            let key = MorphCacheKey::new(from, to, Vec2::new(320.0, 128.0), state.progress);
            let pack = state.topology.uniform_pack();
            println!(
                "  {elapsed_ms:>3}ms progress:{:.2} eased:{:.2} pack:[{:>5.1}, {:>5.1}, {:>5.1}, {:>4.2}] bucket:{} anchor:{:?}",
                state.progress,
                state.eased_progress,
                pack[0],
                pack[1],
                pack[2],
                pack[3],
                key.frame_bucket,
                state.topology.anchor
            );
        }
    }
}