Remove useless DOM layout

master
William Toohey 10 years ago
parent df2b39541b
commit e20f985ced
  1. 4
      src/js/HuesEditor.js

@ -115,6 +115,7 @@ HuesEditor.prototype.resize = function() {
this.root.appendChild(hilight); this.root.appendChild(hilight);
this.hilightWidth = hilight.clientWidth; this.hilightWidth = hilight.clientWidth;
this.hilightHeight = hilight.clientHeight; this.hilightHeight = hilight.clientHeight;
this.editorWidth = this.loopEdit._beatmap.clientWidth;
this.root.removeChild(hilight); this.root.removeChild(hilight);
} }
@ -227,8 +228,7 @@ HuesEditor.prototype.reflow = function(editor, map) {
} else { } else {
editor._hilight.innerHTML = "█"; editor._hilight.innerHTML = "█";
} }
var charWidth = editor._hilight.clientWidth; var charsPerLine = Math.floor(this.editorWidth / this.hilightWidth);
var charsPerLine = Math.floor(editor._beatmap.clientWidth / charWidth);
// if it's too long to wrap, just give up // if it's too long to wrap, just give up
var wrap = Math.min(this.wrapAt, charsPerLine); var wrap = Math.min(this.wrapAt, charsPerLine);
charsPerLine -= charsPerLine % wrap; charsPerLine -= charsPerLine % wrap;

Loading…
Cancel
Save