rect: safer construction
This commit is contained in:
parent
411af0ea18
commit
a1dfc473a2
33 changed files with 245 additions and 159 deletions
|
|
@ -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)?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue