mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🔧 Simplify view interaction log message
Remove zoom_changed from log output as it's no longer needed for debugging after the tile optimization changes.
This commit is contained in:
parent
a8322215dd
commit
969666b39b
@ -301,11 +301,7 @@ pub extern "C" fn set_view_end() {
|
||||
#[cfg(feature = "profile-macros")]
|
||||
{
|
||||
let total_time = performance::get_time() - unsafe { VIEW_INTERACTION_START };
|
||||
performance::console_log!(
|
||||
"[PERF] view_interaction (zoom_changed={}): {}ms",
|
||||
zoom_changed,
|
||||
total_time
|
||||
);
|
||||
performance::console_log!("[PERF] view_interaction: {}ms", total_time);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -2195,7 +2195,11 @@ impl RenderState {
|
||||
* Given a shape, check the indexes and update it's location in the tile set
|
||||
* returns the tiles that have changed in the process.
|
||||
*/
|
||||
pub fn update_shape_tiles(&mut self, shape: &Shape, tree: ShapesPoolRef) -> HashSet<tiles::Tile> {
|
||||
pub fn update_shape_tiles(
|
||||
&mut self,
|
||||
shape: &Shape,
|
||||
tree: ShapesPoolRef,
|
||||
) -> HashSet<tiles::Tile> {
|
||||
let TileRect(rsx, rsy, rex, rey) = self.get_tiles_for_shape(shape, tree);
|
||||
|
||||
// Collect old tiles to avoid borrow conflict with remove_shape_at
|
||||
@ -2447,6 +2451,7 @@ impl RenderState {
|
||||
self.touched_ids.insert(uuid);
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn clean_touched(&mut self) {
|
||||
self.touched_ids.clear();
|
||||
}
|
||||
|
||||
@ -1120,7 +1120,10 @@ impl Shape {
|
||||
}
|
||||
|
||||
/// Returns children in forward (non-reversed) order - useful for layout calculations
|
||||
pub fn children_ids_iter_forward(&self, include_hidden: bool) -> Box<dyn Iterator<Item = &Uuid> + '_> {
|
||||
pub fn children_ids_iter_forward(
|
||||
&self,
|
||||
include_hidden: bool,
|
||||
) -> Box<dyn Iterator<Item = &Uuid> + '_> {
|
||||
if include_hidden {
|
||||
return Box::new(self.children.iter());
|
||||
}
|
||||
|
||||
@ -430,34 +430,26 @@ pub fn propagate_modifiers(
|
||||
}
|
||||
}
|
||||
}
|
||||
// let mut layout_reflows_vec: Vec<Uuid> = layout_reflows.into_iter().collect();
|
||||
// We sort the reflows so they are processed deepest-first in the
|
||||
// tree structure. This way we can be sure that the children layouts
|
||||
// are already reflowed before their parents.
|
||||
let mut layout_reflows_vec: Vec<Uuid> =
|
||||
std::mem::take(&mut layout_reflows).into_iter().collect();
|
||||
layout_reflows_vec.sort_unstable_by(|id_a, id_b| {
|
||||
let da = shapes.get_depth(id_a);
|
||||
let db = shapes.get_depth(id_b);
|
||||
db.cmp(&da)
|
||||
});
|
||||
|
||||
// // We sort the reflows so they are process first the ones that are more
|
||||
// // deep in the tree structure. This way we can be sure that the children layouts
|
||||
// // are already reflowed.
|
||||
// layout_reflows_vec.sort_unstable_by(|id_a, id_b| {
|
||||
// let da = shapes.get_depth(id_a);
|
||||
// let db = shapes.get_depth(id_b);
|
||||
// db.cmp(&da)
|
||||
// });
|
||||
|
||||
// let mut bounds_temp = bounds.clone();
|
||||
// for id in layout_reflows_vec.iter() {
|
||||
// if reflown.contains(id) {
|
||||
// continue;
|
||||
// }
|
||||
// reflow_shape(id, state, &mut reflown, &mut entries, &mut bounds_temp);
|
||||
// }
|
||||
// layout_reflows = HashSet::new();
|
||||
|
||||
for id in std::mem::take(&mut layout_reflows) {
|
||||
if reflown.contains(&id) {
|
||||
for id in &layout_reflows_vec {
|
||||
if reflown.contains(id) {
|
||||
continue;
|
||||
}
|
||||
reflow_shape(&id, state, &mut reflown, &mut entries, &mut bounds);
|
||||
reflow_shape(id, state, &mut reflown, &mut entries, &mut bounds);
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
modifiers
|
||||
.iter()
|
||||
.map(|(key, val)| TransformEntry::from_input(*key, *val))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user