We are striving to align a group of tspan elements both vertically and horizontally.
However, the parent container is not taking into consideration dy values.
This lack of consideration is leading to alignment issues.
If you adjust the dy values in this Codepen example, you'll notice that the height of the text container remains constant: https://codepen.io/anon/pen/WLpvrG?editors=1111.
How can we accurately determine the bounding rectangle for tspan elements?
<svg id="textBox1" class="textBox" x="0%" y="0%" width="100%" height="25%">
<rect class="background" x="0%" y="0%" width="100%" height="100%" fill="gray" fill-opacity="0.5" />
<text class="tspanGroup" x="0" y="0"><tspan x="50%" dy="0em" text-anchor="middle">tspan line 0</tspan><tspan x="50%" dy="1.5em" text-anchor="middle">tspan line 1</tspan><tspan x="50%" dy="1.5em" text-anchor="middle">tspan line 2</tspan></text>
</svg>