aboutsummaryrefslogtreecommitdiff
path: root/src/ui/mapper/style
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/mapper/style')
-rw-r--r--src/ui/mapper/style/PreferredSizeStylerMapper.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/mapper/style/PreferredSizeStylerMapper.cpp b/src/ui/mapper/style/PreferredSizeStylerMapper.cpp
index b4382c19..9e03dfeb 100644
--- a/src/ui/mapper/style/PreferredSizeStylerMapper.cpp
+++ b/src/ui/mapper/style/PreferredSizeStylerMapper.cpp
@@ -1,4 +1,5 @@
#include "cru/ui/mapper/style/PreferredSizeStylerMapper.h"
+#include "cru/ui/mapper/MapperRegistry.h"
#include "cru/ui/render/MeasureRequirement.h"
#include "cru/ui/style/Styler.h"
@@ -11,14 +12,18 @@ bool PreferredSizeStylerMapper::XmlElementIsOfThisType(
ClonablePtr<ui::style::PreferredSizeStyler>
PreferredSizeStylerMapper::DoMapFromXml(xml::XmlElementNode* node) {
render::MeasureSize size;
+
+ auto measure_length_mapper =
+ MapperRegistry::GetInstance()->GetMapper<render::MeasureLength>();
+
auto width_attribute = node->GetOptionalAttributeCaseInsensitive(u"width");
if (width_attribute) {
- size.width = width_attribute->ParseToFloat();
+ size.width = measure_length_mapper->MapFromString(*width_attribute);
}
auto height_attribute = node->GetOptionalAttributeCaseInsensitive(u"height");
if (height_attribute) {
- size.height = height_attribute->ParseToFloat();
+ size.height = measure_length_mapper->MapFromString(*height_attribute);
}
return ui::style::PreferredSizeStyler::Create(size);