Toddy.Iced.ContentFit (Toddy v0.3.0)

Copy Markdown View Source

Scaling mode for the content_fit prop on image and SVG widgets.

Maps to iced's ContentFit enum.

Summary

Functions

Encodes a content fit value to the wire format.

Types

t()

@type t() :: :contain | :cover | :fill | :none | :scale_down

Functions

encode(value)

@spec encode(content_fit :: t()) :: String.t()

Encodes a content fit value to the wire format.

Examples

iex> Toddy.Iced.ContentFit.encode(:contain)
"contain"

iex> Toddy.Iced.ContentFit.encode(:cover)
"cover"

iex> Toddy.Iced.ContentFit.encode(:fill)
"fill"

iex> Toddy.Iced.ContentFit.encode(:none)
"none"

iex> Toddy.Iced.ContentFit.encode(:scale_down)
"scale_down"