mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
✨ Removed method set_selrect_for_current_shape
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user