epaint/
brush.rs

1use crate::{Rect, TextureId};
2
3/// Controls texturing of a [`crate::RectShape`].
4#[derive(Copy, Clone, Debug, PartialEq, Eq)]
5#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
6pub struct Brush {
7    /// If the rect should be filled with a texture, which one?
8    ///
9    /// The texture is multiplied with [`crate::RectShape::fill`].
10    pub fill_texture_id: TextureId,
11
12    /// What UV coordinates to use for the texture?
13    ///
14    /// To display a texture, set [`Self::fill_texture_id`],
15    /// and set this to `Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0))`.
16    ///
17    /// Use [`Rect::ZERO`] to turn off texturing.
18    pub uv: Rect,
19}