mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 03:48:12 +08:00
Use f64 type in layout
This commit is contained in:
committed by
Keavon Chambers
parent
c1cf1fb89f
commit
da817da9b1
@@ -128,7 +128,7 @@ impl AttributeParser {
|
||||
// AbsolutePx: px
|
||||
Some([value, px]) if px.eq_ignore_ascii_case("px") => {
|
||||
let pixels = value
|
||||
.parse::<f32>()
|
||||
.parse::<f64>()
|
||||
.expect(&format!("Invalid value `{}` specified in the attribute type`{}` when parsing XML layout", value, attribute_type)[..]);
|
||||
let dimension = Dimension::AbsolutePx(pixels);
|
||||
TypeValueOrArgument::TypeValue(TypeValue::Dimension(dimension))
|
||||
@@ -136,7 +136,7 @@ impl AttributeParser {
|
||||
// Percent: ?%
|
||||
Some([value, "%"]) => {
|
||||
let percent = value
|
||||
.parse::<f32>()
|
||||
.parse::<f64>()
|
||||
.expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]);
|
||||
let dimension = Dimension::Percent(percent);
|
||||
TypeValueOrArgument::TypeValue(TypeValue::Dimension(dimension))
|
||||
@@ -144,7 +144,7 @@ impl AttributeParser {
|
||||
// PercentRemainder: ?@
|
||||
Some([value, "@"]) => {
|
||||
let percent_remainder = value
|
||||
.parse::<f32>()
|
||||
.parse::<f64>()
|
||||
.expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]);
|
||||
let dimension = Dimension::PercentRemainder(percent_remainder);
|
||||
TypeValueOrArgument::TypeValue(TypeValue::Dimension(dimension))
|
||||
|
||||
Reference in New Issue
Block a user