summaryrefslogtreecommitdiff
path: root/packer/src/lib.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2024-01-01 19:41:32 -0500
committerMicha White <botahamec@outlook.com>2024-01-01 19:41:32 -0500
commit488c7ed94b0662222fa0d825ab81b60b0b1e5d6c (patch)
tree83d7c6b2d7a0de9bedffbc5760396f965b6d10cb /packer/src/lib.rs
parent82a737798b5694e353971a00f46d117743d2a03e (diff)
Created a texture packer
Diffstat (limited to 'packer/src/lib.rs')
-rw-r--r--packer/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/packer/src/lib.rs b/packer/src/lib.rs
index 06c66ae..328f90e 100644
--- a/packer/src/lib.rs
+++ b/packer/src/lib.rs
@@ -1,5 +1,6 @@
+use std::collections::HashMap;
+use std::ops::Deref;
use std::sync::Arc;
-use std::{collections::HashMap, ops::Deref};
use exun::RawUnexpected;
use image::{GenericImage, RgbImage};
@@ -92,6 +93,7 @@ impl RectanglePacker {
let mut rectangles = Vec::with_capacity(self.textures.len());
self.textures.sort();
+ self.textures.reverse();
for texture in &self.textures {
// loop to the next row if we've gone off the edge
if (x_position + texture.0.width()) > image_width {