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

@ -216,7 +216,7 @@ impl WlOutputGlobal {
name,
state: state.clone(),
connector: connector.clone(),
pos: Cell::new(Rect::new_sized(x, y, width, height).unwrap()),
pos: Cell::new(Rect::new_sized_saturating(x, y, width, height)),
output_id: output_id.clone(),
mode: Cell::new(connector_state.mode),
refresh_nsec: Cell::new(connector_state.mode.refresh_nsec()),
@ -343,7 +343,7 @@ impl WlOutputGlobal {
self.damage_matrix.set(matrix);
self.connector
.damage_intersect
.set(Rect::new_sized_unchecked(0, 0, mode.width, mode.height));
.set(Rect::new_sized_saturating(0, 0, mode.width, mode.height));
}
pub fn add_damage_area(&self, area: &Rect) {