fix: add selection_mask and selection_bounds fields to IcedDocument

These fields are required by the spec (section S2) but were missed during
initial implementation. They support selection mask alpha channel data
and selection bounding box coordinates.
This commit is contained in:
2026-07-15 03:04:50 +03:00
parent f30858c65d
commit 7bff36d006
@@ -203,6 +203,10 @@ pub struct IcedDocument {
pub transform_drag_handle: TransformHandle,
/// Internal clipboard for copy/paste operations
pub internal_clipboard: Option<SelectionTransform>,
/// Selection mask (alpha channel) for the current selection
pub selection_mask: Option<Vec<u8>>,
/// Selection bounds (x, y, width, height)
pub selection_bounds: Option<(u32, u32, u32, u32)>,
/// Crop tool state
pub crop_state: CropState,
}
@@ -524,6 +528,8 @@ impl HcieIcedApp {
selection_transform: None,
transform_drag_handle: TransformHandle::None,
internal_clipboard: None,
selection_mask: None,
selection_bounds: None,
crop_state: CropState::default(),
};
@@ -1804,6 +1810,8 @@ impl HcieIcedApp {
selection_transform: None,
transform_drag_handle: TransformHandle::None,
internal_clipboard: None,
selection_mask: None,
selection_bounds: None,
crop_state: CropState::default(),
});
self.active_doc = self.documents.len() - 1;
@@ -2223,6 +2231,8 @@ impl HcieIcedApp {
selection_transform: None,
transform_drag_handle: TransformHandle::None,
internal_clipboard: None,
selection_mask: None,
selection_bounds: None,
crop_state: CropState::default(),
});
}