mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
fix merge of smaller piskel into bigger piskel
This commit is contained in:
parent
4d07a4eb90
commit
92934502e8
@ -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 New Issue
Block a user