diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index 8fae7b9..4de71df 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -548,6 +548,7 @@ $(function () { var terminalGcodeProxy;//todo remove(prob not used anymore). used to display gcode actualy sent to printer. var cubeCamera;//todo make reflections optional. var nozzleModel; + var highlightMaterial; var clock; var dimensionsGroup; @@ -910,9 +911,7 @@ $(function () { //color: new THREE.Color(curColorHex),// rainbow.getColor(layers.length % 64).getHex() vertexColors: THREE.VertexColors, }); - //todo. handle window resize -// curMaterial.resolution.set(gcodeWid, gcodeHei); - curMaterial.resolution.set(500, 500); + curMaterial.resolution.set(gcodeWid, gcodeHei); //for plain lines var curLineBasicMaterial = new THREE.LineBasicMaterial( { @@ -942,9 +941,12 @@ $(function () { if(gcodeGroup){ for (var i = gcodeGroup.children.length - 1; i >= 0; i--) { gcodeGroup.remove(gcodeGroup.children[i]); - } + } } } + this.setResolution = function(w, h) { + curMaterial.resolution.set(w, h); + } easeOutBounce= function (t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; @@ -1112,7 +1114,7 @@ $(function () { if (child.name.startsWith("layer#")) { var filePositions=child.userData.filePositions; var fpMin=filePositions[0]; - var fpMax = filePositions[filePositions.length]; + var fpMax = filePositions[filePositions.length - 1]; if (fpMaxPrettyGCode 0.1 - - ---> - - +{% autoescape true %} +{% endautoescape %} diff --git a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 index 47235f6..9c09565 100644 --- a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 +++ b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 @@ -1,3 +1,4 @@ +{% autoescape true %}
@@ -90,7 +91,7 @@ Additional CSS:
- +
+{% endautoescape %}