Passing actual color in fill attribute

This commit is contained in:
Justin Bell 2021-01-26 15:22:53 +00:00
parent 20adbeed14
commit ca3edb72a1
1 changed files with 3 additions and 1 deletions

View File

@ -57,11 +57,13 @@ fn export_svg<W: Write>(scene: &Scene, writer: &mut W) -> io::Result<()> {
for draw_path_index in 0..scene.draw_path_count() {
let draw_path_id = DrawPathId(draw_path_index);
let draw_path = scene.get_draw_path(draw_path_id);
let paint = scene.get_paint(draw_path.paint);
write!(writer, " <path")?;
if !draw_path.name.is_empty() {
write!(writer, " id=\"{}\"", draw_path.name)?;
}
writeln!(writer, " fill=\"{:?}\" d=\"{:?}\" />", draw_path.paint, draw_path.outline)?;
writeln!(writer, " fill=\"{:?}\" d=\"{:?}\" />", paint.base_color(), draw_path.outline)?;
}
writeln!(writer, "</svg>")?;
Ok(())