mirror of https://github.com/Leinnan/rpack.git
Formating fixes
This commit is contained in:
parent
6e2820b500
commit
476b8d067f
|
|
@ -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<()> {
|
||||
|
|
|
|||
|
|
@ -70,26 +70,25 @@ 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) {
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
index.map(|x| (x, rect))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue