[librsvg/rustify-rsvg-convert] create_surface, not crate_surface :)
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustify-rsvg-convert] create_surface, not crate_surface :)
- Date: Thu, 14 Jan 2021 02:17:54 +0000 (UTC)
commit f84ee9d3ddadcb75287ee2156c7c53c43670b145
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jan 13 20:17:27 2021 -0600
create_surface, not crate_surface :)
src/bin/rsvg-convert/main.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/bin/rsvg-convert/main.rs b/src/bin/rsvg-convert/main.rs
index 42b906aa..296508dc 100644
--- a/src/bin/rsvg-convert/main.rs
+++ b/src/bin/rsvg-convert/main.rs
@@ -378,7 +378,7 @@ impl Converter {
let renderer = CairoRenderer::new(&handle).with_dpi(self.dpi.0, self.dpi.1);
// Create the surface once on the first input
- surface.get_or_init(|| self.crate_surface(&renderer, input));
+ surface.get_or_init(|| self.create_surface(&renderer, input));
surface.get().map(|s| {
s.render(
@@ -397,7 +397,7 @@ impl Converter {
});
}
- fn crate_surface(&self, renderer: &CairoRenderer, input: &Input) -> Surface {
+ fn create_surface(&self, renderer: &CairoRenderer, input: &Input) -> Surface {
let (width, height) = renderer
.legacy_layer_size_in_pixels(self.export_id.as_deref())
.unwrap_or_else(|e| match e {
@@ -425,10 +425,14 @@ impl Converter {
_ => ResizeStrategy::FitLargestScale(self.zoom, self.width, self.height),
};
+ dbg!(strategy);
+
let size = strategy
.apply(Size::new(width, height), self.keep_aspect_ratio)
.unwrap_or_else(|_| exit!("The SVG {} has no dimensions", input));
+ dbg!(size);
+
let output_stream = match self.output {
Output::Stdout => Stdout::stream().upcast::<OutputStream>(),
Output::Path(ref p) => {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]