mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-18 17:56:56 +02:00
fix(komorebi): account for border offset and width in layout
The layout should leave the space configured for the border, so that the border always stays within the workspace bounds. Border offset is cleaned up, as it is no longer a rect, but instead just a fixed value. The rect function for adjusting padding now takes a concrete value, as the optional has no local meaning to the operation, being equivalent to the default value. A margin function is added to centralize the notion of increasing the size of a rect by the given margin, the opposite of the padding operation.
This commit is contained in:
@@ -189,7 +189,7 @@ impl Arrangement for DefaultLayout {
|
||||
|
||||
dimensions
|
||||
.iter_mut()
|
||||
.for_each(|l| l.add_padding(container_padding));
|
||||
.for_each(|l| l.add_padding(container_padding.unwrap_or_default()));
|
||||
|
||||
dimensions
|
||||
}
|
||||
@@ -312,7 +312,7 @@ impl Arrangement for CustomLayout {
|
||||
|
||||
dimensions
|
||||
.iter_mut()
|
||||
.for_each(|l| l.add_padding(container_padding));
|
||||
.for_each(|l| l.add_padding(container_padding.unwrap_or_default()));
|
||||
|
||||
dimensions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user