MCPcopy Index your code
hub / github.com/processing/processing / getFloatWithUnit

Method getFloatWithUnit

core/src/processing/core/PShapeSVG.java:1435–1438  ·  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

1433 * @return unit-parsed version of the data
1434 */
1435 static protected float getFloatWithUnit(XML element, String attribute, float relativeTo) {
1436 String val = element.getString(attribute);
1437 return (val == null) ? 0 : parseUnitSize(val, relativeTo);
1438 }
1439
1440
1441 /**

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