styles = parseStyleAttributes(style);
@@ -1206,10 +1178,10 @@ public class PShapeSVG extends PShape {
public LinearGradient(PShapeSVG parent, XMLElement properties) {
super(parent, properties);
- this.x1 = properties.getFloatAttribute("x1");
- this.y1 = properties.getFloatAttribute("y1");
- this.x2 = properties.getFloatAttribute("x2");
- this.y2 = properties.getFloatAttribute("y2");
+ this.x1 = getFloatWithUnit(properties, "x1");
+ this.y1 = getFloatWithUnit(properties, "y1");
+ this.x2 = getFloatWithUnit(properties, "x2");
+ this.y2 = getFloatWithUnit(properties, "y2");
String transformStr =
properties.getStringAttribute("gradientTransform");
@@ -1250,9 +1222,9 @@ public class PShapeSVG extends PShape {
public RadialGradient(PShapeSVG parent, XMLElement properties) {
super(parent, properties);
- this.cx = properties.getFloatAttribute("cx");
- this.cy = properties.getFloatAttribute("cy");
- this.r = properties.getFloatAttribute("r");
+ this.cx = getFloatWithUnit(properties, "cx");
+ this.cy = getFloatWithUnit(properties, "cy");
+ this.r = getFloatWithUnit(properties, "r");
String transformStr =
properties.getStringAttribute("gradientTransform");
@@ -1589,7 +1561,7 @@ public class PShapeSVG extends PShape {
* beneath them can be used here.
*
* // This code grabs "Layer 3" and the shapes beneath it.
- * SVG layer3 = svg.getChild("Layer 3");
+ * PShape layer3 = svg.getChild("Layer 3");
*
*/
public PShape getChild(String name) {