From 0d47e577752d39bccec96ca11b0efb918bc0c0e6 Mon Sep 17 00:00:00 2001 From: jean-airoldie <25088801+jean-airoldie@users.noreply.github.com> Date: Sat, 19 Mar 2022 08:01:33 -0400 Subject: [PATCH] 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. --- epaint/src/tessellator.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epaint/src/tessellator.rs b/epaint/src/tessellator.rs index f46af30d..95fde7f8 100644 --- a/epaint/src/tessellator.rs +++ b/epaint/src/tessellator.rs @@ -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).