andymeneely / squib

A Ruby DSL for prototyping card games.
http://squib.rocks
MIT License
918 stars 67 forks source link

SVG: alignment-baseline="middle" aligns element's bottom edge instead of middle #302

Open nickolasreynolds opened 4 years ago

nickolasreynolds commented 4 years ago

I've run into an issue with SVG text rendering: it seems like the Squib's SVG library doesn't calculate alignment-baseline="middle" correctly.

Here's an example of how to perfectly (vertically) center text that works in other places I've tried: https://codepen.io/techhysahil/pen/POJWpW

But in Squib, the bottom of the text is always locked to the center of the container. The proper behavior should be locking the middle of the text to the center of the container.