File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,19 +391,36 @@ PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
391391 {
392392 if ( isFrame )
393393 {
394- targetWidth = frame . width ;
395- targetHeight = frame . height ;
394+ if ( texture . crop )
395+ {
396+ targetWidth = texture . crop . width ;
397+ targetHeight = texture . crop . height ;
398+ }
399+ else
400+ {
401+ targetWidth = frame . width ;
402+ targetHeight = frame . height ;
403+ }
396404
397405 newTextureRequired = true ;
398406 }
399407 }
400408 else
401409 {
402- targetWidth = PIXI . getNextPowerOfTwo ( frame . width ) ;
403- targetHeight = PIXI . getNextPowerOfTwo ( frame . height ) ;
410+ if ( texture . crop )
411+ {
412+ targetWidth = PIXI . getNextPowerOfTwo ( texture . crop . width ) ;
413+ targetHeight = PIXI . getNextPowerOfTwo ( texture . crop . height ) ;
414+ }
415+ else
416+ {
417+ targetWidth = PIXI . getNextPowerOfTwo ( frame . width ) ;
418+ targetHeight = PIXI . getNextPowerOfTwo ( frame . height ) ;
419+ }
420+ newTextureRequired = true ;
404421
405422 // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas
406- if ( frame . width !== targetWidth || frame . height !== targetHeight || texture . baseTexture . width !== targetWidth || texture . baseTexture . height || targetHeight ) newTextureRequired = true ;
423+ // if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true;
407424 }
408425
409426 if ( newTextureRequired )
You can’t perform that action at this time.
0 commit comments