Closed dan-fritchman closed 6 months ago
You're right. It looks like SVG interprets this stuff differently: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/dominant-baseline
Based on that document then it would map as follows: | Two.js | SVG | |
---|---|---|---|
1. | text.baseline = "top"; |
dominant-baseline="hanging" |
|
2. | text-baseline = "middle"; |
dominant-baseline="middle" |
|
3. | text-baseline = "bottom"; |
dominant-baseline="auto" |
Thanks for jumping on this. And agree that looks right. Particularly Mozilla’s featured example.
And I think I understand enough to get you an effective PR here. If you’ve got advice, preferences, or things to know, appreciate sharing.
Oop, thanks for this but I beat you to it 😅
This will be published on npm in the next week or so. I have a couple of other PRs that need tending to. Thanks for posting!
Awesome thanks!
https://codepen.io/jonobr1/pen/MWvVBdx
That code snippet, with the WebGL backend, looks like so:
Change it to
canvas
, and it looks like so:Which are not, like, identical, but for purposes of this, close enough.
But change to
Two.Types.svg
, and it looks like so:Is that the expected behavior?
I.e. does the
baseline
attribute not work with the SVG back-end?