Removed method set_selrect_for_current_shape

This commit is contained in:
alonso.torres
2025-10-21 09:40:38 +02:00
parent e9230b8b54
commit e58b2453b1
2 changed files with 2 additions and 20 deletions

View File

@@ -253,8 +253,8 @@ pub extern "C" fn set_shape_masked_group(masked: bool) {
#[no_mangle] #[no_mangle]
pub extern "C" fn set_shape_selrect(left: f32, top: f32, right: f32, bottom: f32) { pub extern "C" fn set_shape_selrect(left: f32, top: f32, right: f32, bottom: f32) {
with_state_mut!(state, { with_current_shape_mut!(state, |shape: &mut Shape| {
state.set_selrect_for_current_shape(left, top, right, bottom); shape.set_selrect(left, top, right, bottom);
}); });
} }

View File

@@ -157,24 +157,6 @@ impl State {
} }
} }
/// Sets the selection rectangle for the current shape and processes its ancestors
///
/// When a shape's selection rectangle changes, all its ancestors need to have their
/// extended rectangles recalculated because the shape's bounds may have changed.
/// This ensures proper rendering of frames and groups containing the modified shape.
// FIXME: PERFORMANCE
pub fn set_selrect_for_current_shape(&mut self, left: f32, top: f32, right: f32, bottom: f32) {
let shape = {
let Some(shape) = self.current_shape_mut() else {
panic!("Invalid current shape")
};
shape.set_selrect(left, top, right, bottom);
shape.clone()
};
self.render_state
.process_shape_ancestors(&shape, &mut self.shapes, &self.modifiers);
}
pub fn update_tile_for_shape(&mut self, shape_id: Uuid) { pub fn update_tile_for_shape(&mut self, shape_id: Uuid) {
if let Some(shape) = self.shapes.get(&shape_id) { if let Some(shape) = self.shapes.get(&shape_id) {
self.render_state self.render_state