Pre-fill the pixmap with the background color to prevent having white strips at the edge
This commit is contained in:
parent
5e3ab2c7ed
commit
c6eee17618
@ -543,6 +543,10 @@ fn redraw(
|
||||
let move_x = (buf_x - image_size) as f32 / 2.0;
|
||||
let move_y = (buf_y - image_size) as f32 / 2.0;
|
||||
let mut pixmap = tiny_skia::Pixmap::new(buf_x, buf_y).unwrap();
|
||||
// pre-fill the pixmap with our background color so we don’t have a white strip at the edges
|
||||
pixmap.fill(
|
||||
tiny_skia::Color::from_rgba(19f32 / 255f32, 17f32 / 255f32, 30f32 / 255f32, 1f32).unwrap(),
|
||||
);
|
||||
resvg::render(
|
||||
&svg_tree,
|
||||
usvg::FitTo::Size(image_size, image_size),
|
||||
|
Loading…
Reference in New Issue
Block a user