resizeArtboard

fun resizeArtboard(artboardHandle: ArtboardHandle, surface: RiveSurface, scaleFactor: Float = 1.0f)

Resizes an artboard to match the dimensions of the given surface.

ℹ️ This is required when setting the fit type to Fit.Layout, where the artboard is expected to match the dimensions of the surface it is drawn to and layout its children within those bounds.

Parameters

artboardHandle

The handle of the artboard to resize.

surface

The surface whose width and height will be used to resize the artboard.

scaleFactor

The scale factor to apply when resizing. The artboard will be resized to surface dimensions divided by this factor.

Throws

If the CommandQueue has been released or surface is closed.