From 34034474d5782d10715ee95b235314ad9cdf0548 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Wed, 8 Jan 2020 15:14:12 -0800 Subject: [PATCH] support strikethrough --- src/renderer/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 64e5923..15626fa 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -107,6 +107,12 @@ impl Renderer { canvas.draw_text_blob(blob, (x, y), &self.paint); } + if style.strikethrough { + let line_position = region.center_y(); + self.paint.set_color(style.special(&default_colors).to_color()); + canvas.draw_line((x, line_position), (x + width, line_position), &self.paint); + } + canvas.restore(); }