GCODE Viewer: Fix issue with lookup of layer index 0

We were just testing if z_heights[z] was truthy. If the layer index was
set but 0 that wasn't properly detected and let to overwriting our
layer information. Instead check explicitly against undefined.

Closes #2017
This commit is contained in:
Gina Häußge 2017-07-24 12:52:13 +02:00
parent e06c09e206
commit 0456896d71

View file

@ -545,7 +545,7 @@ var doParse = function () {
}
if (typeof(z) !== 'undefined' && z !== prevZ) {
if (z_heights[z]) {
if (z_heights[z] !== undefined) {
layer = z_heights[z];
} else {
layer = model.length;