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

@ -632,7 +632,7 @@ impl CpuJob for RenderJob {
.async_upload_from_buffer(
&gfx_buffer,
data.clone(),
Region::new(Rect::new_sized_unchecked(0, 0, rt.width, rt.height)),
Region::new(Rect::new_sized_saturating(0, 0, rt.width, rt.height)),
)
.map_err(TextError::Upload)
} else {
@ -650,7 +650,7 @@ impl CpuJob for RenderJob {
&staging,
data.clone(),
Rc::new(data.memfd.data(rt.stride, rt.height)),
Region::new(Rect::new_sized_unchecked(0, 0, rt.width, rt.height)),
Region::new(Rect::new_sized_saturating(0, 0, rt.width, rt.height)),
)
.map_err(TextError::Upload)
};