redhotmagma-visualization 1.34.0 → 1.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Three/Three2D.js CHANGED
@@ -781,53 +781,61 @@ var Three2D = /*#__PURE__*/function (_ThreeBase) {
781
781
  switch (_context7.prev = _context7.next) {
782
782
  case 0:
783
783
  this._redraw = (_this$_getDrawingCont = this._getDrawingContext).bind.apply(_this$_getDrawingCont, [this].concat(Array.prototype.slice.call(_args7)));
784
+ _context7.prev = 1;
785
+ _context7.next = 4;
786
+ return this._redrawPromise;
784
787
 
785
- if (!this._redrawPromise) {
786
- window.cancelAnimationFrame(this._redrawFrame);
787
- this._redrawPromise = new Promise(function (resolve, reject) {
788
- _this5._redrawFrame = window.requestAnimationFrame( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
789
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
790
- while (1) {
791
- switch (_context6.prev = _context6.next) {
792
- case 0:
793
- _context6.prev = 0;
794
- _context6.next = 3;
795
- return _this5.redraw();
796
-
797
- case 3:
798
- resolve();
799
- _context6.next = 9;
800
- break;
788
+ case 4:
789
+ _context7.next = 8;
790
+ break;
801
791
 
802
- case 6:
803
- _context6.prev = 6;
804
- _context6.t0 = _context6["catch"](0);
805
- reject(_context6.t0);
792
+ case 6:
793
+ _context7.prev = 6;
794
+ _context7.t0 = _context7["catch"](1);
806
795
 
807
- case 9:
808
- _context6.prev = 9;
809
- delete _this5._redrawPromise;
810
- return _context6.finish(9);
796
+ case 8:
797
+ this._redrawPromise = new Promise(function (resolve, reject) {
798
+ _this5._redrawFrame = window.requestAnimationFrame( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
799
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
800
+ while (1) {
801
+ switch (_context6.prev = _context6.next) {
802
+ case 0:
803
+ _context6.prev = 0;
804
+ _context6.next = 3;
805
+ return _this5.redraw();
811
806
 
812
- case 12:
813
- case "end":
814
- return _context6.stop();
815
- }
816
- }
817
- }, _callee6, null, [[0, 6, 9, 12]]);
818
- })));
819
- });
820
- }
807
+ case 3:
808
+ resolve();
809
+ _context6.next = 9;
810
+ break;
821
811
 
822
- _context7.next = 4;
812
+ case 6:
813
+ _context6.prev = 6;
814
+ _context6.t0 = _context6["catch"](0);
815
+ reject(_context6.t0);
816
+
817
+ case 9:
818
+ _context6.prev = 9;
819
+ delete _this5._redrawPromise;
820
+ return _context6.finish(9);
821
+
822
+ case 12:
823
+ case "end":
824
+ return _context6.stop();
825
+ }
826
+ }
827
+ }, _callee6, null, [[0, 6, 9, 12]]);
828
+ })));
829
+ });
830
+ _context7.next = 11;
823
831
  return this._redrawPromise;
824
832
 
825
- case 4:
833
+ case 11:
826
834
  case "end":
827
835
  return _context7.stop();
828
836
  }
829
837
  }
830
- }, _callee7, this);
838
+ }, _callee7, this, [[1, 6]]);
831
839
  }));
832
840
 
833
841
  function getDrawingContext() {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "redhotmagma-visualization",
3
- "version": "1.34.0",
3
+ "version": "1.34.1",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.34.0",
9
+ "@configuratorware/scripts": "1.34.1",
10
10
  "@tweenjs/tween.js": "^17.6.0",
11
11
  "console-polyfill": "^0.3.0",
12
12
  "css-element-queries": "^1.2.3",
@@ -411,21 +411,23 @@ export class Three2D extends ThreeBase {
411
411
 
412
412
  async getDrawingContext() {
413
413
  this._redraw = this._getDrawingContext.bind(this, ...arguments);
414
- if (!this._redrawPromise) {
415
- window.cancelAnimationFrame(this._redrawFrame);
416
- this._redrawPromise = new Promise((resolve, reject) => {
417
- this._redrawFrame = window.requestAnimationFrame(async () => {
418
- try {
419
- await this.redraw();
420
- resolve();
421
- } catch (e) {
422
- reject(e);
423
- } finally {
424
- delete this._redrawPromise;
425
- }
426
- });
427
- });
414
+ try {
415
+ await this._redrawPromise;
416
+ } catch (e) {
417
+ // continue drawing anyway
428
418
  }
419
+ this._redrawPromise = new Promise((resolve, reject) => {
420
+ this._redrawFrame = window.requestAnimationFrame(async () => {
421
+ try {
422
+ await this.redraw();
423
+ resolve();
424
+ } catch (e) {
425
+ reject(e);
426
+ } finally {
427
+ delete this._redrawPromise;
428
+ }
429
+ });
430
+ });
429
431
  await this._redrawPromise;
430
432
  }
431
433