UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

22 lines (20 loc) 659 B
"use strict"; function updateQuadBounds(bounds, anchor, texture) { const { width, height } = texture.orig; const trim = texture.trim; if (trim) { const sourceWidth = trim.width; const sourceHeight = trim.height; bounds.minX = trim.x - anchor._x * width; bounds.maxX = bounds.minX + sourceWidth; bounds.minY = trim.y - anchor._y * height; bounds.maxY = bounds.minY + sourceHeight; } else { bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } } export { updateQuadBounds }; //# sourceMappingURL=updateQuadBounds.mjs.map