fix: pad_rect typos

This commit is contained in:
Ashley Wulber 2026-04-27 18:57:48 -04:00 committed by Victoria Brekenfeld
parent db06770a6b
commit 77f57a656d
2 changed files with 4 additions and 4 deletions

View file

@ -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)
}

View file

@ -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)