pub trait BlockRenderer {
// Required methods
fn measure_height(&self, block: &Block, width: f32, font_size: f32) -> f32;
fn render_rects(
&self,
block: &Block,
x: f32,
y: f32,
width: f32,
rects: &mut Vec<RectInstance>,
);
}Expand description
Trait implemented by each block type’s renderer.
Required Methods§
Sourcefn measure_height(&self, block: &Block, width: f32, font_size: f32) -> f32
fn measure_height(&self, block: &Block, width: f32, font_size: f32) -> f32
Compute the height this block will occupy at the given width.
Sourcefn render_rects(
&self,
block: &Block,
x: f32,
y: f32,
width: f32,
rects: &mut Vec<RectInstance>,
)
fn render_rects( &self, block: &Block, x: f32, y: f32, width: f32, rects: &mut Vec<RectInstance>, )
Emit rectangles for this block at the given position.