-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
145 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Packer from "./Packer"; | ||
|
||
const METHOD = { | ||
Automatic: "Automatic" | ||
}; | ||
|
||
class OptimalPacker extends Packer { | ||
constructor(width, height, allowRotate=false) { | ||
super(); | ||
} | ||
|
||
pack(data, method) { | ||
throw new Error('OptimalPacker is a dummy and cannot be used directly'); | ||
} | ||
|
||
static get type() { | ||
return "OptimalPacker"; | ||
} | ||
|
||
static get methods() { | ||
return METHOD; | ||
} | ||
|
||
static getMethodProps(id='') { | ||
switch(id) { | ||
case METHOD.Automatic: | ||
return {name: "Automatic", description: ""}; | ||
default: | ||
throw Error("Unknown method " + id); | ||
} | ||
} | ||
} | ||
|
||
export default OptimalPacker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters