Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test-debug": "cross-env TS_NODE_PROJECT=tsconfig.tests.json floss --path tests -r ts-node/register --debug",
"test-cov": "cross-env TS_NODE_PROJECT=tsconfig.tests.json nyc --reporter=lcov floss --path tests -r ts-node/register",
"ci": "pnpm install && npm run build && npm run b:types && npm run test-cov",
"lint": "eslint packages/*/src --ext .ts",
"lint": "eslint 'packages/*/src/**/*.ts'",
"watch": "rollup -cw -m inline",
"b:types": "pnpm -r --filter=./packages/* run b:types",
"build": "rollup -c",
Expand Down Expand Up @@ -52,7 +52,8 @@
"rollup-plugin-glslify": "^1.3.1",
"rollup-plugin-swc3": "^0.8.0",
"ts-node": "^10",
"typescript": "^4.8.3"
"typescript": "^4.8.3",
"maxrects-packer": "2.7.3"
},
"husky": {
"hooks": {
Expand Down
5 changes: 3 additions & 2 deletions packages/atlas-algorithm/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@galacean/tools-atlas-algorithm",
"version": "1.5.0-alpha.0",
"version": "1.6.0-beta.0",
"description": "图集打包工具的算法",
"scripts": {
"b:types": "tsc",
"lint:fix": "tslint --fix --project ./tsconfig.json"
"lint:fix": "tslint --fix --project ./tsconfig.json",
"test": "../../node_modules/.bin/cross-env TS_NODE_PROJECT=./tests/tsconfig.json node -r ts-node/register tests/index.ts"
},
"publishConfig": {
"access": "public"
Expand Down
13 changes: 13 additions & 0 deletions packages/atlas-algorithm/src/MaxRects/IMaxRectsBinPack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Rect } from "../Rect";

export interface IMaxRectsBinPack {
binWidth: number;
binHeight: number;
allowRotate: boolean;
usedRectangles: Array<Rect>;
freeRectangles: Array<Rect>;

init(width: number, height: number, allowRotate: boolean): void;
insert(width: number, height: number, method: number): Rect;
insert2(rectangles: Array<Rect>, method: number): Array<Rect>;
}
Loading