@@ -82,11 +82,27 @@ Elm.Native.Graphics.Text = function(elm) {
82 return "<a href='" + toText(href) + "'>" + text + "</a>";
82 return "<a href='" + toText(href) + "'>" + text + "</a>";
85+ function htmlHeight(txt, width) {
86+ var t = document.createElement('div');
88+ t.style.width = w + "px";
89+ t.style.visibility = "hidden";
90+ t.style.styleFloat = "left";
91+ t.style.cssFloat = "left";
93+ document.body.appendChild(t);
94+ var h = t.clientHeight
95+ document.body.removeChild(t);
85 function position(pos) { return function(text) {
100 function position(pos) { return function(text) {
86 var e = {ctor:'RawHtml',
101 var e = {ctor:'RawHtml',
87 _0: '<div style="padding:0;margin:0;text-align:'+pos+'">'+text+'</div>'
102 _0: '<div style="padding:0;margin:0;text-align:'+pos+'">'+text+'</div>'
104+ var w = elm.node.clientWidth;
89− return A3(Element.newElement, 0, 0, e);
105+ return A3(Element.newElement, w, htmlHeight(text, w), e);