I would like to have a layer's height be determined by the amount of text inside its html content (given the style of that text). Is there any way to do this? Thanks!
3 Comments
Sigurd Tapio Mannsåker
One trick is that when you add some text via the HTML property, it's actually wrapped in a div. You can set it to display: inline-block, and then check its offsetHeight. On mobile and I forget the exact name of the property, but there's a reference to it on your layer object. Something like layer._innerElement or something.
3 Comments