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

@ -332,7 +332,7 @@ impl CursorImageScaled {
yhot: i32,
) -> Result<Rc<Self>, CursorError> {
Ok(Rc::new(Self {
extents: Rect::new_sized(-xhot, -yhot, width, height).unwrap(),
extents: Rect::new_sized_saturating(-xhot, -yhot, width, height),
tex: ctx
.clone()
.shmem_texture(None, data, ARGB8888, width, height, width * 4, None)?,