-
public class FitDescribes how size differences are handled between an authored Rive artboard and its containing view.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFit.LayoutInvokes the Rive layout engine to apply responsive layout to the artboard. This assumes that the artboard was designed with layouts in mind.
public final classFit.ContainPreserve aspect ratio and scale the artboard so that its larger dimension matches the corresponding dimension of the containing view.
If aspect ratios are not identical, this will leave space on the larger axis.
public final classFit.ScaleDownPreserve aspect ratio and behave like Fit.Contain when the artboard is larger than the containing view. Otherwise, use the artboard's original dimensions.
public final classFit.CoverPreserve aspect ratio and scale the artboard so that its smaller dimension matches the corresponding dimension of the containing view.
If aspect ratios are not identical, this will clip the artboard on the larger dimension.
public final classFit.FitWidthPreserve aspect ratio and scale the artboard width to match the containing view's width.
If the aspect ratios between the artboard and containing view do not match, this will result in either vertical clipping or space in the vertical axis.
public final classFit.FitHeightPreserve aspect ratio and scale the artboard height to match the containing view's height.
If the aspect ratios between the artboard and containing view do not match, this will result in either horizontal clipping or space in the horizontal axis.
public classFit.FillDo not preserve aspect ratio and stretch to the containing view's dimensions.
public final classFit.NoneDo not scale. Use the artboard's original dimensions.
For either dimension, if the artboard's dimension is larger, it will be clipped. If it is smaller, it will leave space.
-
Field Summary
Fields Modifier and Type Field Description private final Alignmentalignmentprivate final FloatscaleFactor
-
Method Summary
Modifier and Type Method Description AlignmentgetAlignment()Default alignment. FloatgetScaleFactor()Default scale factor. -
-
Method Detail
-
getAlignment
Alignment getAlignment()
Default alignment. Not relevant for all fit modes, but still passed when drawing or on pointer events.
-
getScaleFactor
Float getScaleFactor()
Default scale factor. Only relevant with Fit.Layout, but still passed when drawing or on pointer events.
-
-
-
-