Add Tessellator::set_clip_rect (#1369)

This allows the user to set the outer rectangle used for culling,
which is required to be able to implement its own tessellate_shapes.
This commit is contained in:
jean-airoldie 2022-03-19 08:01:33 -04:00 committed by GitHub
parent cecb48af03
commit 0d47e57775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -695,6 +695,11 @@ impl Tessellator {
}
}
/// Set the `Rect` to use for culling.
pub fn set_clip_rect(&mut self, clip_rect: Rect) {
self.clip_rect = clip_rect;
}
/// Tessellate a single [`Shape`] into a [`Mesh`].
///
/// * `tex_size`: size of the font texture (required to normalize glyph uv rectangles).