From e20f985cedef11c85c4c5027a6682e83d557c4d6 Mon Sep 17 00:00:00 2001 From: William Toohey Date: Wed, 3 Feb 2016 21:28:21 +1000 Subject: [PATCH] Remove useless DOM layout --- src/js/HuesEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/HuesEditor.js b/src/js/HuesEditor.js index 142e49c..9e6ab0a 100644 --- a/src/js/HuesEditor.js +++ b/src/js/HuesEditor.js @@ -115,6 +115,7 @@ HuesEditor.prototype.resize = function() { this.root.appendChild(hilight); this.hilightWidth = hilight.clientWidth; this.hilightHeight = hilight.clientHeight; + this.editorWidth = this.loopEdit._beatmap.clientWidth; this.root.removeChild(hilight); } @@ -227,8 +228,7 @@ HuesEditor.prototype.reflow = function(editor, map) { } else { editor._hilight.innerHTML = "█"; } - var charWidth = editor._hilight.clientWidth; - var charsPerLine = Math.floor(editor._beatmap.clientWidth / charWidth); + var charsPerLine = Math.floor(this.editorWidth / this.hilightWidth); // if it's too long to wrap, just give up var wrap = Math.min(this.wrapAt, charsPerLine); charsPerLine -= charsPerLine % wrap;