fix: pad_rect typos
This commit is contained in:
parent
db06770a6b
commit
77f57a656d
2 changed files with 4 additions and 4 deletions
|
|
@ -111,11 +111,11 @@ pub fn pad_rect(
|
|||
padding: &[i32; 4],
|
||||
) -> Option<Rectangle<i32, Logical>> {
|
||||
rect.size.h = rect.size.h.checked_sub(padding[0])?;
|
||||
rect.loc.x += padding[0];
|
||||
rect.loc.x += padding[3];
|
||||
rect.size.w = rect.size.w.checked_sub(padding[1])?;
|
||||
rect.size.h = rect.size.h.checked_sub(padding[2])?;
|
||||
rect.size.w = rect.size.w.checked_sub(padding[3])?;
|
||||
rect.loc.y += padding[3];
|
||||
rect.loc.y += padding[0];
|
||||
Some(rect)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -646,9 +646,9 @@ fn pad_rect(
|
|||
padding: &Padding,
|
||||
) -> Option<Rectangle<i32, Logical>> {
|
||||
rect.size.h = rect.size.h.checked_sub(padding.top)?;
|
||||
rect.loc.x += padding.top;
|
||||
rect.loc.x += padding.left;
|
||||
rect.size.w = rect.size.w.checked_sub(padding.left)?;
|
||||
rect.loc.y += padding.left;
|
||||
rect.loc.y += padding.top;
|
||||
rect.size.h = rect.size.h.checked_sub(padding.bottom)?;
|
||||
rect.size.w = rect.size.w.checked_sub(padding.right)?;
|
||||
Some(rect)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue