From 02dc6a18c69b388b39e4becc7540ac44f6d818c8 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Wed, 29 Jun 2016 12:25:05 +0200 Subject: [PATCH] try to draw 1000*1000 svg grig --- src/arenas/tron/js.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/arenas/tron/js.js b/src/arenas/tron/js.js index f2bc05f..a9c0220 100644 --- a/src/arenas/tron/js.js +++ b/src/arenas/tron/js.js @@ -7,17 +7,16 @@ function createElem(type,attributes){ function createElemNs(type,attributes){ var elem=document.createElementNS("http://www.w3.org/2000/svg",type); for (var i in attributes) - {elem.setAttribute(i,attributes[i]);} + {elem.setAttributeNs(null,i,attributes[i]);} return elem; } function tron(bot1,bot2,xdcheck){ - var svg = document.getElementById("map"); - var svgDoc = svg.contentDocument; + //var svgDoc = svg.contentDocument; var rect=createElemNs('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'}); - svgDoc.appendChild(rect); + document.getElementById("map").appendChild(rect); }