Simplify Compositor::create_surface in iced_tiny_skia

This commit is contained in:
Héctor Ramón Jiménez 2025-11-21 02:23:04 +01:00
parent 50026c5e49
commit 1f972ec0af
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -66,18 +66,9 @@ impl crate::graphics::Compositor for Compositor {
)
.expect("Create softbuffer surface for window");
let clip_mask = {
if width > 0 && height > 0 {
tiny_skia::Mask::new(width, height)
} else {
tiny_skia::Mask::new(1, 1)
}
}
.expect("Create clip mask");
let mut surface = Surface {
window,
clip_mask,
clip_mask: tiny_skia::Mask::new(1, 1).expect("Create clip mask"),
layer_stack: VecDeque::new(),
background_color: Color::BLACK,
max_age: 0,