diff --git a/crates/textwrap/src/lib.rs b/crates/textwrap/src/lib.rs index 28ab6fe..6e602a2 100644 --- a/crates/textwrap/src/lib.rs +++ b/crates/textwrap/src/lib.rs @@ -163,12 +163,11 @@ pub struct Layout { } impl Layout { - pub fn draw(&self, cache: &TextCache, ctx: &DrawContext) { - let line_height = 12.0; + pub fn draw(&self, cache: &TextCache, ctx: &DrawContext, scale: f32, line_height: f32) { let mut cursor = Vec2::ZERO; for line in self.lines.iter() { let ctx = ctx.with_offset(cursor); - line.draw(cache, &ctx); + line.draw(cache, &ctx, scale); cursor.y += line_height; } } @@ -209,8 +208,7 @@ impl Line { Self { fragments } } - pub fn draw(&self, cache: &TextCache, ctx: &DrawContext) { - let scale = 10.0; + pub fn draw(&self, cache: &TextCache, ctx: &DrawContext, scale: f32) { let mut cursor = Vec2::ZERO; for fragment in self.fragments.iter() { if !fragment.hidden {