Skip to content

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.

  • width: Rendered texture width.
  • height: Rendered texture height.
  • mult: Optional crop multiplier.
  • left/right/top/bottom: Optional starting tex coords.
  • factor: Optional factor adjustment.

left, right, top, bottom texture coordinates.

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