MCPcopy Index your code
hub / github.com/benfry/processing4 / getFloatWithUnit

Method getFloatWithUnit

core/src/processing/core/PShapeSVG.java:1442–1445  ·  view source on GitHub ↗

Used in place of element.getFloatAttribute(a) because we can have a unit suffix (length or coordinate). @param element what to parse @param attribute name of the attribute to get @param relativeTo (float) Used for %. When relative to viewbox, should be svgWidth for horizontal dimentions, svgHeigh

(XML element, String attribute, float relativeTo)

Source from the content-addressed store, hash-verified

1440 * @return unit-parsed version of the data
1441 */
1442 static protected float getFloatWithUnit(XML element, String attribute, float relativeTo) {
1443 String val = element.getString(attribute);
1444 return (val == null) ? 0 : parseUnitSize(val, relativeTo);
1445 }
1446
1447
1448 /**

Callers 6

parseLineMethod · 0.95
parseEllipseMethod · 0.95
parseRectMethod · 0.95
parseImageMethod · 0.95
LinearGradientMethod · 0.80
RadialGradientMethod · 0.80

Calls 2

parseUnitSizeMethod · 0.95
getStringMethod · 0.65

Tested by

no test coverage detected