MCPcopy Create free account
hub / github.com/Snapchat/Valdi / parseAngle

Method parseAngle

valdi_core/src/valdi_core/cpp/Attributes/AttributeUtils.cpp:131–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131std::optional<double> AttributeParser::parseAngle() {
132 auto angleValue = parseDouble();
133 if (!angleValue) {
134 return std::nullopt;
135 }
136
137 if (tryParse("rad")) {
138 return angleValue.value();
139 } else if (tryParse("deg")) {
140 return angleValue.value() * M_PI / 180.0;
141 } else {
142 setErrorAtCurrentPosition("Unrecognized angle unit");
143 return std::nullopt;
144 }
145}
146
147std::optional<Dimension> AttributeParser::parseDimension() {
148 tryParseWhitespaces();

Callers 2

TESTFunction · 0.80
preprocessGradientFunction · 0.80

Calls 1

valueMethod · 0.65

Tested by 1

TESTFunction · 0.64