Skip to content

Commit

Permalink
#14
Browse files Browse the repository at this point in the history
  • Loading branch information
odrick committed Mar 3, 2020
1 parent ff7df67 commit cb981ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions PackProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ class PackProcessor {
for (let packerClass of allPackers) {
if (packerClass !== OptimalPacker) {
for (let method in packerClass.methods) {
methods.push({ packerClass, packerMethod: packerClass.methods[method] });
methods.push({packerClass, packerMethod: packerClass.methods[method], allowRotation: false});
methods.push({packerClass, packerMethod: packerClass.methods[method], allowRotation: true});
}
}
}
Expand All @@ -157,7 +158,7 @@ class PackProcessor {

let packerClass = options.packer || MaxRectsBinPack;
let packerMethod = options.packerMethod || MaxRectsBinPack.methods.BestShortSideFit;
let packerCombos = (packerClass === OptimalPacker) ? getAllPackers() : [{ packerClass, packerMethod }];
let packerCombos = (packerClass === OptimalPacker) ? getAllPackers() : [{packerClass, packerMethod, allowRotation: options.allowRotation}];

let optimalRes;
let optimalSheets = Infinity;
Expand Down Expand Up @@ -192,7 +193,7 @@ class PackProcessor {
}) : identical;

while(_rects.length) {
let packer = new combo.packerClass(width, height, options.allowRotation);
let packer = new combo.packerClass(width, height, combo.allowRotation);
let result = packer.pack(_rects, combo.packerMethod);

for(let item of result) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "free-tex-packer-core",
"displayName": "Free texture packer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Free texture packer core",
"url": "http://github.com/odrick/free-tex-packer-core",
"main": "index.js",
Expand Down

0 comments on commit cb981ba

Please sign in to comment.