Implement bounding box for selected layers (#349)

* Implement bounding box for selected layers

* Add shift modifier for multi selection
This commit is contained in:
TrueDoctor
2021-08-20 09:57:00 +02:00
committed by Keavon Chambers
parent 7c64e1a816
commit 68d8ae4804
10 changed files with 159 additions and 72 deletions
+4 -1
View File
@@ -83,6 +83,7 @@ pub struct Layer {
pub cache_dirty: bool,
pub blend_mode: BlendMode,
pub opacity: f64,
pub overlay: bool,
}
impl Layer {
@@ -97,6 +98,7 @@ impl Layer {
cache_dirty: true,
blend_mode: BlendMode::Normal,
opacity: 1.,
overlay: false,
}
}
@@ -128,7 +130,7 @@ impl Layer {
}
pub fn intersects_quad(&self, quad: Quad, path: &mut Vec<LayerId>, intersections: &mut Vec<Vec<LayerId>>) {
if !self.visible {
if !self.visible || self.overlay {
return;
}
let transformed_quad = self.transform.inverse() * quad;
@@ -166,6 +168,7 @@ impl Clone for Layer {
cache_dirty: true,
blend_mode: self.blend_mode,
opacity: self.opacity,
overlay: self.overlay,
}
}
}