Formating fixes

This commit is contained in:
Piotr Siuszko 2025-10-04 22:03:03 +02:00
parent 6e2820b500
commit 476b8d067f
2 changed files with 16 additions and 18 deletions

View File

@ -363,9 +363,8 @@ impl TilemapGenerationConfig {
}
}
};
let working_dir = std::path::absolute(dir).unwrap_or_default();
working_dir
std::path::absolute(dir).unwrap_or_default()
}
pub fn generate(&self) -> anyhow::Result<()> {

View File

@ -70,24 +70,23 @@ impl SkylinePacker {
// keep the `bottom` and `width` as small as possible
for i in 0..self.skylines.len() {
if let Some(r) = self.can_put(i, w, h) {
if r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width) {
bottom = r.bottom();
width = self.skylines[i].w;
index = Some(i);
rect = r;
}
if let Some(r) = self.can_put(i, w, h)
&& (r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width))
{
bottom = r.bottom();
width = self.skylines[i].w;
index = Some(i);
rect = r;
}
if self.config.allow_rotation {
if let Some(r) = self.can_put(i, h, w) {
if r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width) {
bottom = r.bottom();
width = self.skylines[i].w;
index = Some(i);
rect = r;
}
}
if self.config.allow_rotation
&& let Some(r) = self.can_put(i, h, w)
&& (r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width))
{
bottom = r.bottom();
width = self.skylines[i].w;
index = Some(i);
rect = r;
}
}