mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 05:37:23 -06:00
Respect SVG image-rendering pixelated attribute
This commit is contained in:
committed by
bflatastic
parent
6664e366e7
commit
aaeb1b2b35
@@ -652,10 +652,16 @@ impl Importer {
|
||||
if link.is_some() && !missing { blob.with_proxy() } else { blob }
|
||||
});
|
||||
let xf = acc * Affine::scale_non_uniform(size.width() as f64 / pw as f64, size.height() as f64 / ph as f64);
|
||||
self.named(
|
||||
let mut node = self.named(
|
||||
i.id(),
|
||||
NodeKind::Image(Box::new(ImageObject { key, width: pw, height: ph, xf, link, placement: Default::default(), pixels: None })),
|
||||
)
|
||||
)?;
|
||||
|
||||
if i.rendering_mode() == usvg::ImageRendering::Pixelated {
|
||||
node.extras_mut().pixelated = true;
|
||||
}
|
||||
|
||||
Some(node)
|
||||
}
|
||||
|
||||
/// An SVG shown as an image (a data URL or a linked file) → its art, `acc` mapping its size.
|
||||
|
||||
Reference in New Issue
Block a user