mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 02:38:13 +08:00
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:
co-authored by
Dennis
otdavies
parent
1a70667f63
commit
eb96eafe60
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user