diff --git a/README.md b/README.md index 6de40b5..b27e50d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Eventually, this will be a level editor... But until then, I guess it's just fun - [x] Control images Z value(so we could reorder them) - [x] Delete images - [x] Name images - - [ ] Duplicate images(and also shapes maybe?)? - [x] Scale images - [x] Show hide shapes - [x] Control shape Z value @@ -33,7 +32,9 @@ Eventually, this will be a level editor... But until then, I guess it's just fun - [ ] Double click on shape in tree view will center the relevant shape - [ ] Grab shapes instead of center points +- [ ] Reorder items tree ## Maybe, just maybe todo -- [ ] Group shapes/images under an empty/another object +- [ ] Group shapes/images under an empty/another object with an actual tree view +- [ ] Duplicate shapes/images diff --git a/src/modify.rs b/src/modify.rs index 930ce49..553de11 100644 --- a/src/modify.rs +++ b/src/modify.rs @@ -61,9 +61,10 @@ pub fn modify_sys( if let Some(size) = assets.get(h).map(|x| x.size()) { let size = size * 0.5; let t = gtransforms.get(e).unwrap(); + let scale = t.to_scale_rotation_translation().0; // Disregard rotations for now plz let diff = (mouse_pos - t.translation().xy()).abs(); - if diff.x < size.x && diff.y < size.y { + if diff.x < size.x * scale.x && diff.y < size.y * scale.y { *holding = Holding::Image(e, mouse_pos - t.translation().xy()); break; } diff --git a/src/ui.rs b/src/ui.rs index 05f7e5c..736b95f 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,7 +1,7 @@ use bevy::math::{Vec3Swizzles, Mat2}; use bevy::prelude::*; use bevy_egui::{egui, EguiContext}; -use bevy_prototype_lyon::prelude::{Path, DrawMode, FillMode, StrokeMode}; +use bevy_prototype_lyon::prelude::{Path, DrawMode}; use crate::*; #[derive(Default, Deref, DerefMut, Clone)]