pub struct SlicerConfig {
pub page_content_height: f32,
pub page_gap: f32,
pub allow_clipping: bool,
pub header_footer: HeaderFooterConfig,
pub page_width: f32,
pub table_headers: TableHeaderTracker,
}Expand description
Configuration for the slicer-based pagination.
Fields§
§page_content_height: f32Height of each page’s content area (excludes margins, headers, footers)
page_gap: f32Height of “dead zone” between pages (for margins, headers, footers) This represents space that content should NOT overlap with
allow_clipping: boolWhether to clip items that span page boundaries (true) or push them to next page (false)
Header and footer configuration
page_width: f32Width of the page content area (for centering headers/footers)
table_headers: TableHeaderTrackerTable headers that need repetition across pages
Implementations§
Source§impl SlicerConfig
impl SlicerConfig
Sourcepub fn simple(page_height: f32) -> Self
pub fn simple(page_height: f32) -> Self
Create a simple slicer config with no gaps between pages.
Sourcepub fn with_gap(page_height: f32, gap: f32) -> Self
pub fn with_gap(page_height: f32, gap: f32) -> Self
Create a slicer config with margins/gaps between pages.
Add header/footer configuration.
Sourcepub fn with_page_width(self, width: f32) -> Self
pub fn with_page_width(self, width: f32) -> Self
Set the page width (for header/footer positioning).
Sourcepub fn with_table_headers(self, tracker: TableHeaderTracker) -> Self
pub fn with_table_headers(self, tracker: TableHeaderTracker) -> Self
Add table headers for repetition.
Sourcepub fn register_table_header(&mut self, info: TableHeaderInfo)
pub fn register_table_header(&mut self, info: TableHeaderInfo)
Register a single table header.
Sourcepub fn page_slot_height(&self) -> f32
pub fn page_slot_height(&self) -> f32
The total height of a page “slot” including the gap.
Sourcepub fn page_for_y(&self, y: f32) -> usize
pub fn page_for_y(&self, y: f32) -> usize
Calculate which page a Y coordinate falls on.
Sourcepub fn page_bounds(&self, page_index: usize) -> (f32, f32)
pub fn page_bounds(&self, page_index: usize) -> (f32, f32)
Get the Y range for a specific page (in infinite canvas coordinates).
Trait Implementations§
Source§impl Clone for SlicerConfig
impl Clone for SlicerConfig
Source§fn clone(&self) -> SlicerConfig
fn clone(&self) -> SlicerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SlicerConfig
impl Debug for SlicerConfig
Source§impl Default for SlicerConfig
impl Default for SlicerConfig
Source§fn default() -> SlicerConfig
fn default() -> SlicerConfig
Auto Trait Implementations§
impl Freeze for SlicerConfig
impl !RefUnwindSafe for SlicerConfig
impl Send for SlicerConfig
impl Sync for SlicerConfig
impl Unpin for SlicerConfig
impl UnsafeUnpin for SlicerConfig
impl !UnwindSafe for SlicerConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more