Use f64 type in layout

This commit is contained in:
Gabriel Majeri
2021-03-27 01:20:51 -07:00
committed by Keavon Chambers
parent c1cf1fb89f
commit da817da9b1
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -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))