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<()> {
|
pub fn generate(&self) -> anyhow::Result<()> {
|
||||||
|
|
|
||||||
|
|
@ -70,26 +70,25 @@ impl SkylinePacker {
|
||||||
|
|
||||||
// keep the `bottom` and `width` as small as possible
|
// keep the `bottom` and `width` as small as possible
|
||||||
for i in 0..self.skylines.len() {
|
for i in 0..self.skylines.len() {
|
||||||
if let Some(r) = self.can_put(i, w, h) {
|
if let Some(r) = self.can_put(i, w, h)
|
||||||
if r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width) {
|
&& (r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width))
|
||||||
|
{
|
||||||
bottom = r.bottom();
|
bottom = r.bottom();
|
||||||
width = self.skylines[i].w;
|
width = self.skylines[i].w;
|
||||||
index = Some(i);
|
index = Some(i);
|
||||||
rect = r;
|
rect = r;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if self.config.allow_rotation {
|
if self.config.allow_rotation
|
||||||
if let Some(r) = self.can_put(i, h, w) {
|
&& let Some(r) = self.can_put(i, h, w)
|
||||||
if r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width) {
|
&& (r.bottom() < bottom || (r.bottom() == bottom && self.skylines[i].w < width))
|
||||||
|
{
|
||||||
bottom = r.bottom();
|
bottom = r.bottom();
|
||||||
width = self.skylines[i].w;
|
width = self.skylines[i].w;
|
||||||
index = Some(i);
|
index = Some(i);
|
||||||
rect = r;
|
rect = r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
index.map(|x| (x, rect))
|
index.map(|x| (x, rect))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue