From 22cf4dd489bc5f55b083f0f394c5aeec18dd282a Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Thu, 31 Aug 2017 22:14:47 +0100 Subject: [PATCH] encapsulate patches inside a div add the patch name float the divs --- index.html | 5 +++++ texture.js | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 3ad9605..022e223 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,11 @@ margin-left: 5px; margin-right: 5px; } + .texdiv { + float: left; + margin: 1em; + text-align: center; + } diff --git a/texture.js b/texture.js index 21083e8..1dfc2c6 100644 --- a/texture.js +++ b/texture.js @@ -220,9 +220,12 @@ function renderAllTextures(element, game) { for (i = 0; i < textures.length; ++i) { var tx = textures[i]; var canvas = tx.drawTexture(ps); - //element.appendChild(document.createTextNode(tx.name)); - element.appendChild(canvas); - //element.appendChild(document.createElement("br")); + var div = document.createElement("div"); + div.className = "texdiv"; + div.appendChild(canvas); + div.appendChild(document.createElement("br")); + div.appendChild(document.createTextNode(tx.name)); + element.appendChild(div); } }); });