-
-
Notifications
You must be signed in to change notification settings - Fork 77
Use default values for properties missing from --settings file #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,23 +30,21 @@ mod visit; | |
| /// High-level output configuration | ||
| #[derive(Debug, Clone, PartialEq)] | ||
| #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
| #[cfg_attr(feature = "serde", serde(default))] | ||
| pub struct ConversionConfig { | ||
| /// Dots per inch for pixels, picas, points, etc. | ||
| pub dpi: f64, | ||
| /// Set the origin point in millimeters for this conversion | ||
| #[cfg_attr(feature = "serde", serde(default = "zero_origin"))] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is OK to remove because
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lgtm, thanks! |
||
| pub origin: [Option<f64>; 2], | ||
| /// Set extra attribute to add when printing node name | ||
| pub extra_attribute_name: Option<String>, | ||
| /// Reorder paths to minimize travel time | ||
| #[cfg_attr(feature = "serde", serde(default))] | ||
| pub optimize_path_order: bool, | ||
| /// CSS selector to filter which SVG elements are converted. | ||
| /// | ||
| /// Only the `:not`, `:is`, and `:has` pseudo classes are supported. | ||
| /// | ||
| /// <https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors> | ||
| #[cfg_attr(feature = "serde", serde(default))] | ||
| pub selector_filter: Option<String>, | ||
| pub starting_point: [Option<f64>; 2], | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this default, we'd need to create settings with empty objects, e.g.
{ "conversion": {} }