Opened 14 years ago
Closed 13 years ago
#2502 closed enhancement (fixed)
[cla] [patch] getTextWidth methods for gfx (vml+svg) text
Reported by: | Owned by: | Eugene Lazutkin | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | gfx (svg+vml) | Version: | 0.4.1 |
Keywords: | gfx text width | Cc: | |
Blocked By: | Blocking: |
Description
In IE it is possible to get the text width with: rawNode.style.display = "inline".
In FF and Opera there is the "orphan issue": solved in FF cloning the text node; in Opera (at the moment) with a while loop: the width is valid when takes a value != 0.
Nicola
Attachments (4)
Change History (9)
Changed 14 years ago by
Changed 14 years ago by
comment:1 Changed 14 years ago by
Status: | new → assigned |
---|
Changed 14 years ago by
Attachment: | vml.js.diff added |
---|
comment:2 Changed 14 years ago by
Two duplications removed in my previous svg.diff
In vml.js now is dojo.gfx.pt2px(...) instead of dojo.gfx.vml.pt2px(...)
Nicola
comment:3 follow-up: 4 Changed 14 years ago by
SVG (in FF at least) also supports "getComputedTextLength" on any SVG text element; this returns an integer.
comment:4 Changed 14 years ago by
Replying to ttrenka:
Both getComputedTextLength() and getBBox().width have the "orphan issue" http://wiki.svg.org/GetBBox in FF and Opera
No flickering with this solution, because the original node and the cloned node have same position and dimensions
Nicola
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
While this is a useful functionality, I am hesitant to update the code, because I don't like modifications of a node directly, or with a measurement node --- it make cause flickering in some cases. We have to make sure that all changes are completely invisible.