(PShapeSVG parent, XML properties)
| 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) { |
nothing calls this directly
no test coverage detected