rect: safer construction
This commit is contained in:
parent
411af0ea18
commit
a1dfc473a2
33 changed files with 245 additions and 159 deletions
|
|
@ -207,13 +207,12 @@ impl XdgPopup {
|
|||
// use its position as is.
|
||||
if let Some(maybe_abs_pos) = maybe_abs_pos {
|
||||
abs_pos = maybe_abs_pos;
|
||||
rel_pos = Rect::new_sized(
|
||||
rel_pos = Rect::new_sized_saturating(
|
||||
abs_pos.x1() - parent_abs.x1(),
|
||||
abs_pos.y1() - parent_abs.y1(),
|
||||
abs_pos.width(),
|
||||
abs_pos.height(),
|
||||
)
|
||||
.unwrap();
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue