Crop Ratio
UI Utility
Computes texture coordinates that preserve a crop ratio for rectangular textures.
NamespaceEModuleCoreLifecyclestable
E:CropRatio(width, height, mult, left, right, top, bottom, factor)Computes texture coordinates that preserve a crop ratio for rectangular textures.
Parameters
Section titled “Parameters”- width: Rendered texture width.
- height: Rendered texture height.
- mult: Optional crop multiplier.
- left/right/top/bottom: Optional starting tex coords.
- factor: Optional factor adjustment.
Returns
Section titled “Returns”left, right, top, bottom texture coordinates.
Example
Section titled “Example”texture:SetTexCoord(E:CropRatio(width, height, 0.5))Useful when addon art needs the same crop behavior as ElvUI widgets.
Source: ElvUI/Game/Shared/General/API.lua:1268