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

Method LineOfText

core/src/processing/core/PShapeSVG.java:1736–1763  ·  view source on GitHub ↗
(PShapeSVG parent, XML properties)

Source from the content-addressed store, hash-verified

1734 PFont font;
1735
1736 public LineOfText(PShapeSVG parent, XML properties) {
1737 // TODO: child should ideally be parsed too for inline content.
1738 super(parent, properties, false);
1739
1740 //get location
1741 float x = Float.parseFloat(properties.getString("x"));
1742 float y = Float.parseFloat(properties.getString("y"));
1743
1744 float parentX = Float.parseFloat(parent.element.getString("x"));
1745 float parentY = Float.parseFloat(parent.element.getString("y"));
1746
1747 if (matrix == null) matrix = new PMatrix2D();
1748 matrix.translate(x - parentX, (y - parentY) / 2f);
1749
1750 // get the first properties
1751 parseColors(properties);
1752 font = parseFont(properties);
1753
1754 // cleaned up syntax but removing b/c unused [fry 190118]
1755 //boolean isLine = properties.getString("role").equals("line");
1756
1757 if (this.childCount > 0) {
1758 // no inline content yet.
1759 }
1760
1761 String text = properties.getContent();
1762 textToDisplay = text;
1763 }
1764
1765 @Override
1766 public void drawImpl(PGraphics g) {

Callers

nothing calls this directly

Calls 6

parseFloatMethod · 0.80
parseColorsMethod · 0.80
parseFontMethod · 0.80
getContentMethod · 0.80
getStringMethod · 0.65
translateMethod · 0.65

Tested by

no test coverage detected