Skip to content
pixi-silk
GitHub repository
Function

fitScale

import { fitScale } from 'pixi-silk/ui/layout';
function fitScale(
   fit: FitMode, 
   w: number, 
   h: number, 
   slotWidth: number, 
   slotHeight: number
): [number, number];

The [x, y] scale of a child of natural size w by h in a slot, for a fit mode. [1, 1] for none or an empty child.

Parameters#

ParameterType
fitFitMode
wnumber
hnumber
slotWidthnumber
slotHeightnumber

Returns#

[number, number]