From cb2d63de6af8f727d2ddd1e1055b97b4b4420a84 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 4 Mar 2014 21:24:03 -0300 Subject: [PATCH] Fix font tests. --- web2d/src/main/javascript/peer/svg/TextPeer.js | 5 +---- web2d/src/test/javascript/render/font.html | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/web2d/src/main/javascript/peer/svg/TextPeer.js b/web2d/src/main/javascript/peer/svg/TextPeer.js index f3d180e3..684c3454 100644 --- a/web2d/src/main/javascript/peer/svg/TextPeer.js +++ b/web2d/src/main/javascript/peer/svg/TextPeer.js @@ -69,10 +69,7 @@ web2d.peer.svg.TextPeer = new Class({ this._native.setAttribute('x', x); // tspan must be positioned manually. - this._native.getElements('tspan').forEach(function (span) { - span.setAttribute('x', x); - }); - + $(this._native).children('tspan').attr('x', x); }, getPosition: function () { diff --git a/web2d/src/test/javascript/render/font.html b/web2d/src/test/javascript/render/font.html index 6448d459..6b8e0d83 100644 --- a/web2d/src/test/javascript/render/font.html +++ b/web2d/src/test/javascript/render/font.html @@ -63,7 +63,7 @@ wText.setColor('red'); }); - overflowWorkspace.addItAsChildTo(document.id(elemId)); + overflowWorkspace.addItAsChildTo($("#"+elemId)); } function alignments(text, family, elemId) { @@ -83,7 +83,7 @@ wText.setTextAlignment(align); }); - overflowWorkspace.addItAsChildTo(document.id(elemId)); + overflowWorkspace.addItAsChildTo($("#"+elemId)); } function initialize() {