Implement stable serialization and restoration for dock layouts, including auto-hidden and floating panels
- Add `persistence.rs` for stable serialization of dock layouts without runtime identifiers. - Introduce `preview.rs` for geometry handling of dock drop previews. - Create `sizing.rs` to manage content-aware sizing policies and constraint solving for dock panels. - Implement `welcome.rs` to provide a welcome surface when no documents are open, featuring New and Open actions.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use hcie_brush_engine::{BrushTip, BrushStyle};
|
||||
use hcie_brush_engine::{BrushStyle, BrushTip};
|
||||
|
||||
fn make_round_tip(size: f32, hardness: f32) -> BrushTip {
|
||||
BrushTip {
|
||||
@@ -14,7 +14,11 @@ fn test_generate_brush_stamp_size() {
|
||||
let tip = make_round_tip(10.0, 0.5);
|
||||
let stamp = hcie_brush_engine::generate_brush_stamp(&tip);
|
||||
let expected_d = 20usize;
|
||||
assert_eq!(stamp.len(), expected_d * expected_d, "stamp should be square");
|
||||
assert_eq!(
|
||||
stamp.len(),
|
||||
expected_d * expected_d,
|
||||
"stamp should be square"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -30,7 +34,11 @@ fn test_generate_brush_stamp_center_nonzero() {
|
||||
fn test_generate_brush_stamp_hardness_gradient() {
|
||||
let soft = hcie_brush_engine::generate_brush_stamp(&make_round_tip(10.0, 0.0));
|
||||
let hard = hcie_brush_engine::generate_brush_stamp(&make_round_tip(10.0, 1.0));
|
||||
assert_eq!(soft.len(), hard.len(), "same size stamp should have same length");
|
||||
assert_eq!(
|
||||
soft.len(),
|
||||
hard.len(),
|
||||
"same size stamp should have same length"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -38,7 +46,11 @@ fn test_brush_spacing_pixels() {
|
||||
let spacing = hcie_brush_engine::brush_spacing_pixels(20.0, 0.5);
|
||||
assert_eq!(spacing, 10.0, "spacing should be size * ratio");
|
||||
let min_spacing = hcie_brush_engine::brush_spacing_pixels(20.0, 0.0);
|
||||
assert!((min_spacing - 0.2).abs() < 0.001, "min spacing should be ~0.2, got {}", min_spacing);
|
||||
assert!(
|
||||
(min_spacing - 0.2).abs() < 0.001,
|
||||
"min spacing should be ~0.2, got {}",
|
||||
min_spacing
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user