bin-packing-core
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -43,6 +43,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return i + v.width; | ||
}, 1); // 防止刚好踩到临界点情况 | ||
}, this.step + 1); // 防止刚好踩到临界点情况 | ||
this.maxHeight = this.rects.reduce(function (i, v) { | ||
return i + v.height; | ||
}, 1); // 防止刚好踩到临界点情况 | ||
}, this.step + 1); // 防止刚好踩到临界点情况 | ||
} | ||
@@ -86,3 +86,3 @@ Object.defineProperty(Search.prototype, "minHeight", { | ||
while (right - left >= this.step) { | ||
mid = (right + left) / 2; | ||
mid = Math.ceil((right + left) / 2); | ||
var _a = this.getInsertResult(width, mid), result = _a[0], op = _a[1]; | ||
@@ -89,0 +89,0 @@ var isSuccess = result.length === this.rects.length; |
{ | ||
"name": "bin-packing-core", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "image packer based on genetic & max-rect algorithm", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -48,6 +48,6 @@ import MaxRectBinPack, { FindPosition } from './max-rect-bin-pack'; | ||
return i + v.width; | ||
}, 1); // 防止刚好踩到临界点情况 | ||
}, this.step + 1); // 防止刚好踩到临界点情况 | ||
this.maxHeight = this.rects.reduce((i, v) => { | ||
return i + v.height; | ||
}, 1); // 防止刚好踩到临界点情况 | ||
}, this.step + 1); // 防止刚好踩到临界点情况 | ||
} | ||
@@ -77,3 +77,3 @@ public search(): IPoint { | ||
while (right - left >= this.step) { | ||
mid = (right + left) / 2; | ||
mid = Math.ceil((right + left) / 2); | ||
const [result, op] = this.getInsertResult(width, mid); | ||
@@ -80,0 +80,0 @@ const isSuccess = result.length === this.rects.length; |
@@ -68,3 +68,3 @@ //tslint:disable | ||
// debugger; | ||
const serach = new Search(rects, false, 1, 0, Infinity); | ||
const serach = new Search(rects, false, 10, 0, Infinity); | ||
const bestNode = serach.search(); | ||
@@ -71,0 +71,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
903517