mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 12:31:38 +02:00
♻️ Refactor how rebuild_tiles works
This commit is contained in:
parent
fef342b489
commit
caf13eb774
8 changed files with 63 additions and 15 deletions
|
@ -73,7 +73,7 @@ impl<'a> State<'a> {
|
|||
pub fn delete_shape(&mut self, id: Uuid) {
|
||||
// We don't really do a self.shapes.remove so that redo/undo keep working
|
||||
if let Some(shape) = self.shapes.get(&id) {
|
||||
let (rsx, rsy, rex, rey) = self.render_state.get_tiles_for_rect(&shape);
|
||||
let (rsx, rsy, rex, rey) = self.render_state.get_tiles_for_shape(&shape);
|
||||
for x in rsx..=rex {
|
||||
for y in rsy..=rey {
|
||||
let tile = (x, y);
|
||||
|
@ -118,6 +118,11 @@ impl<'a> State<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn rebuild_tiles_shallow(&mut self) {
|
||||
self.render_state
|
||||
.rebuild_tiles_shallow(&mut self.shapes, &self.modifiers, &self.structure);
|
||||
}
|
||||
|
||||
pub fn rebuild_tiles(&mut self) {
|
||||
self.render_state
|
||||
.rebuild_tiles(&mut self.shapes, &self.modifiers, &self.structure);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue