New overlay system that reimplements how overlays are drawn (#418)

* New overlay system that reimplements how overlays are drawn

* Fix overlay message declaration

* Fix small mistake

* WIP (broken) changes to plumb the overlay document

* Fix confusion over messaging system architecture

* Removed log

* Overlay system working

* (broken) WIP overlay association

* Finish the overlay system (except test failure)

* Change back IDs in test

* Fixed test, but stilled fails due to revealed real problem with layer reordering selection

* Disable broken test that has a bug in issue #444

Co-authored-by: Dennis <dennis@kobert.dev>
Co-authored-by: otdavies <oliver@psyfer.io>
This commit is contained in:
Keavon Chambers
2021-12-30 09:48:39 -08:00
co-authored by Dennis otdavies
parent 1a70667f63
commit eb96eafe60
22 changed files with 416 additions and 313 deletions
+2 -5
View File
@@ -86,7 +86,6 @@ pub struct Layer {
pub cache_dirty: bool,
pub blend_mode: BlendMode,
pub opacity: f64,
pub overlay: bool,
}
impl Layer {
@@ -101,7 +100,6 @@ impl Layer {
cache_dirty: true,
blend_mode: BlendMode::Normal,
opacity: 1.,
overlay: false,
}
}
@@ -116,7 +114,7 @@ impl Layer {
if self.cache_dirty {
transforms.push(self.transform);
self.thumbnail_cache.clear();
self.data.render(&mut self.thumbnail_cache, transforms, if self.overlay { ViewMode::Normal } else { view_mode });
self.data.render(&mut self.thumbnail_cache, transforms, view_mode);
self.cache.clear();
let _ = writeln!(self.cache, r#"<g transform="matrix("#);
@@ -137,7 +135,7 @@ impl Layer {
}
pub fn intersects_quad(&self, quad: Quad, path: &mut Vec<LayerId>, intersections: &mut Vec<Vec<LayerId>>) {
if !self.visible || self.overlay {
if !self.visible {
return;
}
let transformed_quad = self.transform.inverse() * quad;
@@ -179,7 +177,6 @@ impl Clone for Layer {
cache_dirty: true,
blend_mode: self.blend_mode,
opacity: self.opacity,
overlay: self.overlay,
}
}
}