fix merge of smaller piskel into bigger piskel
This commit is contained in:
parent
4d07a4eb90
commit
92934502e8
1 changed files with 7 additions and 3 deletions
|
@ -17,11 +17,15 @@
|
||||||
* @return {Piskel} The new Piskel instance created
|
* @return {Piskel} The new Piskel instance created
|
||||||
*/
|
*/
|
||||||
merge : function (piskel, importedPiskel, options) {
|
merge : function (piskel, importedPiskel, options) {
|
||||||
|
var isImportedPiskelBigger =
|
||||||
|
importedPiskel.getWidth() > piskel.getWidth() ||
|
||||||
|
importedPiskel.getHeight() > piskel.getHeight();
|
||||||
|
|
||||||
// First make sure both the piskel and the imported piskel use the target dimensions.
|
// First make sure both the piskel and the imported piskel use the target dimensions.
|
||||||
if (options.resize === 'expand') {
|
if (isImportedPiskelBigger && options.resize === 'expand') {
|
||||||
piskel = pskl.utils.ResizeUtils.resizePiskel(piskel, {
|
piskel = pskl.utils.ResizeUtils.resizePiskel(piskel, {
|
||||||
width : importedPiskel.getWidth(),
|
width : Math.max(piskel.getWidth(), importedPiskel.getWidth()),
|
||||||
height : importedPiskel.getHeight(),
|
height : Math.max(piskel.getHeight(), importedPiskel.getHeight()),
|
||||||
origin : options.origin,
|
origin : options.origin,
|
||||||
resizeContent: false
|
resizeContent: false
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue