pub struct TileBrushCalculator { /* private fields */ }Expand description
Calculates the rectangles and transform needed to render a tile brush.
Implementations§
Source§impl TileBrushCalculator
impl TileBrushCalculator
Sourcepub fn from_brush(
brush: &dyn ITileBrush,
content_size: Size,
target_size: Size,
) -> Self
pub fn from_brush( brush: &dyn ITileBrush, content_size: Size, target_size: Size, ) -> Self
Creates a calculator for a tile brush.
brush- The brush to be rendered.content_size- The size of the content of the tile brush.target_size- The size of the control to which the brush is being rendered.
Sourcepub fn new(
tile_mode: TileMode,
stretch: Stretch,
alignment_x: AlignmentX,
alignment_y: AlignmentY,
source_rect: RelativeRect,
destination_rect: RelativeRect,
content_size: Size,
target_size: Size,
) -> Self
pub fn new( tile_mode: TileMode, stretch: Stretch, alignment_x: AlignmentX, alignment_y: AlignmentY, source_rect: RelativeRect, destination_rect: RelativeRect, content_size: Size, target_size: Size, ) -> Self
Initializes a new instance of the TileBrushCalculator type.
tile_mode- The brush’s tile mode.stretch- The brush’s stretch.alignment_x- The brush’s horizontal alignment.alignment_y- The brush’s vertical alignment.source_rect- The brush’s source rectdestination_rect- The brush’s destination rect.content_size- The size of the content of the tile brush.target_size- The size of the control to which the brush is being rendered.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Upstream declares this get-only property and never assigns it, so it is always false.
Sourcepub fn destination_rect(&self) -> Rect
pub fn destination_rect(&self) -> Rect
Gets the rectangle on the destination control to which content should be rendered.
If the tile mode of the brush is repeating then this is describes rectangle of a single repeat of the tiled content.
Sourcepub fn intermediate_clip(&self) -> Rect
pub fn intermediate_clip(&self) -> Rect
Gets the clip rectangle on the intermediate image with which the brush content should be
drawn when needs_intermediate is true.
Sourcepub fn intermediate_size(&self) -> Size
pub fn intermediate_size(&self) -> Size
Gets the size of the intermediate image that should be created when
needs_intermediate is true.
Sourcepub fn intermediate_transform(&self) -> Matrix
pub fn intermediate_transform(&self) -> Matrix
Gets the transform to be used when rendering to the intermediate image when
needs_intermediate is true.
Sourcepub fn needs_intermediate(&self) -> bool
pub fn needs_intermediate(&self) -> bool
Gets a value indicating whether an intermediate image should be created in order to render the tile brush.
Intermediate images are required when a brush’s tile mode is not repeating but the source and destination aspect ratios are unequal, as all of the currently supported rendering backends do not support non-tiled image brushes.
Sourcepub fn source_rect(&self) -> Rect
pub fn source_rect(&self) -> Rect
Gets the area of the source content to be rendered.
pub fn calculate_translate( alignment_x: AlignmentX, alignment_y: AlignmentY, source_rect: Rect, destination_rect: Rect, scale: Vector, ) -> Vector
pub fn calculate_translate_sizes( alignment_x: AlignmentX, alignment_y: AlignmentY, source_size: Size, destination_size: Size, ) -> Vector
Auto Trait Implementations§
impl Freeze for TileBrushCalculator
impl RefUnwindSafe for TileBrushCalculator
impl Send for TileBrushCalculator
impl Sync for TileBrushCalculator
impl Unpin for TileBrushCalculator
impl UnsafeUnpin for TileBrushCalculator
impl UnwindSafe for TileBrushCalculator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more