[core] Obey "transition" property from style and its default value
This commit is contained in:
@@ -86,6 +86,10 @@ StyleParseResult Parser::parse(const std::string& json) {
|
||||
}
|
||||
}
|
||||
|
||||
if (document.HasMember("transition")) {
|
||||
parseTransition(document["transition"]);
|
||||
}
|
||||
|
||||
if (document.HasMember("light")) {
|
||||
parseLight(document["light"]);
|
||||
}
|
||||
@@ -115,6 +119,17 @@ StyleParseResult Parser::parse(const std::string& json) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Parser::parseTransition(const JSValue& value) {
|
||||
conversion::Error error;
|
||||
optional<TransitionOptions> converted = conversion::convert<TransitionOptions>(value, error);
|
||||
if (!converted) {
|
||||
Log::Warning(Event::ParseStyle, error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
transition = std::move(*converted);
|
||||
}
|
||||
|
||||
void Parser::parseLight(const JSValue& value) {
|
||||
conversion::Error error;
|
||||
optional<Light> converted = conversion::convert<Light>(value, error);
|
||||
|
||||
Reference in New Issue
Block a user