From f46536ecc8402077e74681f8f7fa9085a28bab28 Mon Sep 17 00:00:00 2001 From: Arkitu <85173315+Arkitu@users.noreply.github.com> Date: Sun, 25 May 2025 09:42:51 +0200 Subject: [PATCH] working zoom on mobile --- Cargo.lock | 10 ---------- Cargo.toml | 1 - src/ui.rs | 3 ++- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9184fea..5d1bfdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,7 +352,6 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eaad7fe854258047680c51c3cacb804468553c04241912f6254c841c67c0198" dependencies = [ - "bevy_dylib", "bevy_internal", ] @@ -584,15 +583,6 @@ dependencies = [ "sysinfo", ] -[[package]] -name = "bevy_dylib" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381b2a0773cfe9d27256fba1e5005a14968b34f751c09397ee4e278f0fb235db" -dependencies = [ - "bevy_internal", -] - [[package]] name = "bevy_ecs" version = "0.15.3" diff --git a/Cargo.toml b/Cargo.toml index f7f054b..3eda2c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ bevy = { version = "0.15", default-features = false, features = [ "png", "tonemapping_luts", "bevy_pbr", - "dynamic_linking", ] } #bevy-inspector-egui = { version = "0.28", default-features = false, features = [ # "bevy_image", diff --git a/src/ui.rs b/src/ui.rs index 31cc640..62d4f02 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -86,7 +86,8 @@ fn setup(mut world: Commands, asset_server: Res) { if ptrs.0.len() > 1 { let forward = cam.forward(); - cam.translation += forward * (old_d_to_midpoint/new_d_to_midpoint * 0.1); + let z = cam.translation.z; + cam.translation += forward * (z * (1. - (new_d_to_midpoint/old_d_to_midpoint)) / forward.z); // cam.scale *= old_d_to_midpoint/new_d_to_midpoint; } }