mirror of
https://github.com/penpot/penpot.git
synced 2025-06-11 21:41:39 +02:00
🐛 Fix wasm glitches
This commit is contained in:
parent
26a2ef8fb7
commit
64e6d0b1f8
5 changed files with 68 additions and 14 deletions
|
@ -1,6 +1,18 @@
|
|||
use super::{Image, Viewbox};
|
||||
use skia::Contains;
|
||||
use skia_safe as skia;
|
||||
|
||||
pub(crate) struct CachedSurfaceImage {
|
||||
pub image: Image,
|
||||
pub viewbox: Viewbox,
|
||||
pub invalid: bool,
|
||||
pub has_all_shapes: bool,
|
||||
}
|
||||
|
||||
impl CachedSurfaceImage {
|
||||
pub fn invalidate_if_dirty(&mut self, viewbox: &Viewbox) {
|
||||
if !self.has_all_shapes && !self.viewbox.area.contains(viewbox.area) {
|
||||
self.invalid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue