print: Adjust 100% to SVG physical dimensions
Some SVGs store there size in cm or inch. With this change, the 100% in the print dialog is calculated according to that physical size. Closes #141
This commit is contained in:
parent
04dfed4678
commit
d138750448
5 changed files with 45 additions and 22 deletions
|
|
@ -25,7 +25,7 @@ use super::{DecoderUpdate, UpdateSender};
|
|||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub enum ImageDimensionDetails {
|
||||
Svg(String),
|
||||
Svg(String, Option<(f64, f64)>),
|
||||
#[default]
|
||||
None,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,10 @@ impl Svg {
|
|||
let image = image_request.request().await?;
|
||||
|
||||
let dimensions = if let Some(string) = image.info().dimensions_text.as_ref() {
|
||||
ImageDimensionDetails::Svg(string.to_string())
|
||||
ImageDimensionDetails::Svg(
|
||||
string.to_string(),
|
||||
image.info().dimensions_inch.clone().into(),
|
||||
)
|
||||
} else {
|
||||
ImageDimensionDetails::None
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue