message: fix: more robust when z, z2, zlevel is invalid
diff: @@ -9,6 +9,15 @@ import timsort from './core/timsort';
  import Displayable from './graphic/Displayable';
  import { Path } from './export';
  +let invalidZErrorLogged = false;
  +function logInvalidZError() {
  + if (invalidZErrorLogged) {
  + return;
  + }
  + invalidZErrorLogged = true;
  + console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');
  +}
  +
  function shapeCompareFunc(a: Displayable, b: Displayable) {
  if (a.zlevel === b.zlevel) {
  if (a.z === b.z) {
  @@ -146,6 +155,20 @@ export default class Storage {
  disp.__clipPaths = [];
  }
  + // Avoid invalid z, z2, zlevel cause sorting error.
  + if (isNaN(disp.z)) {
  + logInvalidZError();
  + disp.z = 0;
  + }
  + if (isNaN(disp.z2)) {
  + logInvalidZError();
  + disp.z2 = 0;
  + }
  + if (isNaN(disp.zlevel)) {
  + logInvalidZError();
  + disp.zlevel = 0;
  + }
  +
  this._displayList[this._displayListLen++] = disp;
  }
  