mirror of
https://github.com/penpot/penpot.git
synced 2026-03-18 16:33:49 +00:00
🎉 Improve performance reducing unnecessary calls to set-objects
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::uuid::Uuid;
|
||||
use skia_safe as skia;
|
||||
use std::collections::HashMap;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub type Image = skia::Image;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
use skia_safe as skia;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::uuid::Uuid;
|
||||
use crate::view::Viewbox;
|
||||
use indexmap::IndexSet;
|
||||
use skia_safe as skia;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
pub type Tile = (i32, i32);
|
||||
|
||||
@@ -64,6 +63,12 @@ impl TileHashMap {
|
||||
return self.grid.get(&tile);
|
||||
}
|
||||
|
||||
pub fn remove_shape_at(&mut self, tile: Tile, id: Uuid) {
|
||||
if let Some(shapes) = self.grid.get_mut(&tile) {
|
||||
shapes.shift_remove(&id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_tiles_of(&mut self, shape_id: Uuid) -> Option<&HashSet<Tile>> {
|
||||
self.index.get(&shape_id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user