zng::image

Function img_crop

source
pub fn img_crop(child: impl UiNode, crop: impl IntoVar<Rect>) -> impl UiNode
Expand description

P Sets a Rect that is a clip applied to all inner images before their layout.

Relative values are calculated from the image pixel size, the img_scale_ppi is only considered after. Note that more complex clipping can be applied after to the full widget, this property exists primarily to render selections of a texture atlas.

By default no cropping is done.