Re: Text metrics with display:none

On Sunday, December 11, 2011, 3:31:41 PM, David wrote:

DD> Oftentimes I have found myself drawing stuff invisibly first, so
DD> that I can measure it. Then after knowing how big it will be I position it.

DD> Centering things relative to one another is difficult in SVG
DD> (unlike in HTML/CSS), and CSS doesn't seem to help with this issue
DD> (unless I'm missing something -- and I well may be), so when I
DD> start finding parts of the spec that tell me I cannot measure
DD> things unless they are visible, it makes me nervous. I recall a
DD> similar issue recently with getBBox and leprechaun-nodes. 

If you want things to be rendered (but invisible) - as opposed to not being in the rendering tree at all, which is what display: none does - then visibility: hidden is what you want.





-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups

Received on Monday, 12 December 2011 14:27:55 UTC