1
0
Fork 0
forked from wry/wry

rect: safer construction

This commit is contained in:
Stipe Kotarac 2025-12-29 10:42:17 +01:00 committed by Julian Orth
parent 411af0ea18
commit a1dfc473a2
33 changed files with 245 additions and 159 deletions

View file

@ -86,7 +86,7 @@ impl WlBuffer {
id,
destroyed: Cell::new(false),
client: client.clone(),
rect: Rect::new_sized(0, 0, width, height).unwrap(),
rect: Rect::new_sized_saturating(0, 0, width, height),
format,
width,
height,
@ -154,7 +154,7 @@ impl WlBuffer {
id,
destroyed: Cell::new(false),
client: client.clone(),
rect: Rect::new_sized(0, 0, width, height).unwrap(),
rect: Rect::new_sized_saturating(0, 0, width, height),
format,
dmabuf: None,
render_ctx_version: Cell::new(client.state.render_ctx_version.get()),
@ -183,7 +183,7 @@ impl WlBuffer {
id,
destroyed: Cell::new(false),
client: client.clone(),
rect: Rect::new_sized(0, 0, 1, 1).unwrap(),
rect: Rect::new_sized_saturating(0, 0, 1, 1),
format: ARGB8888,
dmabuf: None,
render_ctx_version: Cell::new(client.state.render_ctx_version.get()),