diff --git a/render-wasm/src/main.rs b/render-wasm/src/main.rs index f2ab215147..d80ae3b0ea 100644 --- a/render-wasm/src/main.rs +++ b/render-wasm/src/main.rs @@ -253,8 +253,8 @@ pub extern "C" fn set_shape_masked_group(masked: bool) { #[no_mangle] pub extern "C" fn set_shape_selrect(left: f32, top: f32, right: f32, bottom: f32) { - with_state_mut!(state, { - state.set_selrect_for_current_shape(left, top, right, bottom); + with_current_shape_mut!(state, |shape: &mut Shape| { + shape.set_selrect(left, top, right, bottom); }); } diff --git a/render-wasm/src/state.rs b/render-wasm/src/state.rs index 9d641a8626..62ed73053d 100644 --- a/render-wasm/src/state.rs +++ b/render-wasm/src/state.rs @@ -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) { if let Some(shape) = self.shapes.get(&shape_id) { self.render_state