pub struct MagnifierDecoration {
pub opacity: f64,
pub shadows: Option<Vec<BoxShadow>>,
pub shape: ShapeBorderRef,
}Expand description
The decorations to put around the loupe in a RawMagnifier.
See also:
Decoration, a more general solution forDecoratedBox.
Fields§
§opacity: f64The opacity of the magnifier and decorations around the magnifier.
When this is 1.0, the magnified image shows in the shape of the
magnifier. When this is less than 1.0, the magnified image is transparent
and shows through the unmagnified background.
Generally this is only useful for animating the magnifier in and out, as a transparent magnifier looks quite confusing.
shadows: Option<Vec<BoxShadow>>A list of shadows cast by the shape.
If the shadows are offset, consider setting RawMagnifier::clip_behavior to
Clip::HardEdge (or similar) to ensure the shadow does not occlude the
magnifier (the shadow is drawn above the magnifier).
If the shadows are not offset, consider using BlurStyle::Outer in the
shadows instead, to avoid having to introduce a clip.
In the event that shape consists of a stack of borders, the shadow
is drawn using the bounds of the last one.
See also:
kElevationToShadow, which defines some shadows for Material design. Those shadows useBlurStyle::Normaland may need to be converted toBlurStyle::Outerfor use withMagnifierDecoration.
shape: ShapeBorderRefThe shape of the magnifier and the outline (border) around it.
Shapes can be stacked (using plus). In that case, the magnifier and shadow are
drawn according to the outside edge of the last shape, with the borders painted on
top.
Implementations§
Source§impl MagnifierDecoration
impl MagnifierDecoration
Sourcepub fn new() -> MagnifierDecoration
pub fn new() -> MagnifierDecoration
Constructs a MagnifierDecoration.
By default, MagnifierDecoration is a rectangular magnifier with no
shadows, and fully opaque.
Sourcepub fn opacity(self, opacity: f64) -> MagnifierDecoration
pub fn opacity(self, opacity: f64) -> MagnifierDecoration
Dart MagnifierDecoration(opacity:).
Sourcepub fn shadows(self, shadows: Vec<BoxShadow>) -> MagnifierDecoration
pub fn shadows(self, shadows: Vec<BoxShadow>) -> MagnifierDecoration
Dart MagnifierDecoration(shadows:).
Sourcepub fn shape(self, shape: impl Into<ShapeBorderRef>) -> MagnifierDecoration
pub fn shape(self, shape: impl Into<ShapeBorderRef>) -> MagnifierDecoration
Dart MagnifierDecoration(shape:).