Function webrender::prim_store::line_dec::get_line_decoration_size
source ยท pub fn get_line_decoration_size(
rect_size: &LayoutSize,
orientation: LineOrientation,
style: LineStyle,
wavy_line_thickness: f32,
) -> Option<LayoutSize>
Expand description
Choose the decoration mask tile size for a given line.
Given a line with overall size rect_size
and the given orientation
,
return the dimensions of a single mask tile for the decoration pattern
described by style
and wavy_line_thickness
.
If style
is Solid
, no mask tile is necessary; return None
. The other
styles each have their own characteristic periods of repetition, so for each
one, this function returns a LayoutSize
with the right aspect ratio and
whose specific size is convenient for the cs_line_decoration.glsl
fragment
shader to work with. The shader uses a local coordinate space in which the
tile fills a rectangle with one corner at the origin, and with the size this
function returns.
The returned size is not necessarily in pixels; device scaling and other concerns can still affect the actual task size.
Regardless of whether orientation
is Vertical
or Horizontal
, the
width
and height
of the returned size are always horizontal and
vertical, respectively.