Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { TilingSprite } from '@pixi/sprite-tiling';
import { canvasUtils } from '@pixi/canvas-renderer';
import { CanvasRenderTarget } from '@pixi/utils';
/**
* Renders the object using the Canvas renderer
*
* @protected
* @function _renderCanvas
* @memberof PIXI.TilingSprite#
* @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer
*/
TilingSprite.prototype._renderCanvas = function _renderCanvas(renderer)
{
const texture = this._texture;
if (!texture.baseTexture.valid)
{
return;
}
const context = renderer.context;
const transform = this.worldTransform;
const resolution = renderer.resolution;
const baseTexture = texture.baseTexture;
const source = baseTexture.getDrawableSource();
const baseTextureResolution = baseTexture.resolution;
const modX = ((this.tilePosition.x / this.tileScale.x) % texture._frame.width) * baseTextureResolution;
const modY = ((this.tilePosition.y / this.tileScale.y) % texture._frame.height) * baseTextureResolution;