@antv/g-canvas 1.9.39 → 1.9.41

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/dist/index.esm.js CHANGED
@@ -379,36 +379,34 @@ var Canvas2DContextService = /*#__PURE__*/function () {
379
379
  var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
380
380
  var _this$canvasConfig, container, canvas, $canvas;
381
381
  return _regeneratorRuntime().wrap(function _callee$(_context) {
382
- while (1) {
383
- switch (_context.prev = _context.next) {
384
- case 0:
385
- _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
386
- if (canvas) {
387
- this.$canvas = canvas;
388
- if (container && canvas.parentElement !== container) {
389
- container.appendChild(canvas);
390
- }
391
- this.$container = canvas.parentElement;
392
- this.canvasConfig.container = this.$container;
393
- } else if (container) {
394
- // create container
395
- this.$container = isString(container) ? document.getElementById(container) : container;
396
- if (this.$container) {
397
- // create canvas
398
- $canvas = document.createElement('canvas');
399
- this.$container.appendChild($canvas);
400
- if (!this.$container.style.position) {
401
- this.$container.style.position = 'relative';
402
- }
403
- this.$canvas = $canvas;
382
+ while (1) switch (_context.prev = _context.next) {
383
+ case 0:
384
+ _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
385
+ if (canvas) {
386
+ this.$canvas = canvas;
387
+ if (container && canvas.parentElement !== container) {
388
+ container.appendChild(canvas);
389
+ }
390
+ this.$container = canvas.parentElement;
391
+ this.canvasConfig.container = this.$container;
392
+ } else if (container) {
393
+ // create container
394
+ this.$container = isString(container) ? document.getElementById(container) : container;
395
+ if (this.$container) {
396
+ // create canvas
397
+ $canvas = document.createElement('canvas');
398
+ this.$container.appendChild($canvas);
399
+ if (!this.$container.style.position) {
400
+ this.$container.style.position = 'relative';
404
401
  }
402
+ this.$canvas = $canvas;
405
403
  }
406
- this.context = this.$canvas.getContext('2d');
407
- this.resize(this.canvasConfig.width, this.canvasConfig.height);
408
- case 4:
409
- case "end":
410
- return _context.stop();
411
- }
404
+ }
405
+ this.context = this.$canvas.getContext('2d');
406
+ this.resize(this.canvasConfig.width, this.canvasConfig.height);
407
+ case 4:
408
+ case "end":
409
+ return _context.stop();
412
410
  }
413
411
  }, _callee, this);
414
412
  }));
@@ -468,18 +466,16 @@ var Canvas2DContextService = /*#__PURE__*/function () {
468
466
  var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
469
467
  var _options, type, encoderOptions;
470
468
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
471
- while (1) {
472
- switch (_context2.prev = _context2.next) {
473
- case 0:
474
- if (options === void 0) {
475
- options = {};
476
- }
477
- _options = options, type = _options.type, encoderOptions = _options.encoderOptions;
478
- return _context2.abrupt("return", this.context.canvas.toDataURL(type, encoderOptions));
479
- case 3:
480
- case "end":
481
- return _context2.stop();
482
- }
469
+ while (1) switch (_context2.prev = _context2.next) {
470
+ case 0:
471
+ if (options === void 0) {
472
+ options = {};
473
+ }
474
+ _options = options, type = _options.type, encoderOptions = _options.encoderOptions;
475
+ return _context2.abrupt("return", this.context.canvas.toDataURL(type, encoderOptions));
476
+ case 3:
477
+ case "end":
478
+ return _context2.stop();
483
479
  }
484
480
  }, _callee2, this);
485
481
  }));
package/dist/index.js CHANGED
@@ -398,36 +398,34 @@ var Canvas2DContextService = /*#__PURE__*/function () {
398
398
  var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
399
399
  var _this$canvasConfig, container, canvas, $canvas;
400
400
  return _regeneratorRuntime().wrap(function _callee$(_context) {
401
- while (1) {
402
- switch (_context.prev = _context.next) {
403
- case 0:
404
- _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
405
- if (canvas) {
406
- this.$canvas = canvas;
407
- if (container && canvas.parentElement !== container) {
408
- container.appendChild(canvas);
409
- }
410
- this.$container = canvas.parentElement;
411
- this.canvasConfig.container = this.$container;
412
- } else if (container) {
413
- // create container
414
- this.$container = util.isString(container) ? document.getElementById(container) : container;
415
- if (this.$container) {
416
- // create canvas
417
- $canvas = document.createElement('canvas');
418
- this.$container.appendChild($canvas);
419
- if (!this.$container.style.position) {
420
- this.$container.style.position = 'relative';
421
- }
422
- this.$canvas = $canvas;
401
+ while (1) switch (_context.prev = _context.next) {
402
+ case 0:
403
+ _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas;
404
+ if (canvas) {
405
+ this.$canvas = canvas;
406
+ if (container && canvas.parentElement !== container) {
407
+ container.appendChild(canvas);
408
+ }
409
+ this.$container = canvas.parentElement;
410
+ this.canvasConfig.container = this.$container;
411
+ } else if (container) {
412
+ // create container
413
+ this.$container = util.isString(container) ? document.getElementById(container) : container;
414
+ if (this.$container) {
415
+ // create canvas
416
+ $canvas = document.createElement('canvas');
417
+ this.$container.appendChild($canvas);
418
+ if (!this.$container.style.position) {
419
+ this.$container.style.position = 'relative';
423
420
  }
421
+ this.$canvas = $canvas;
424
422
  }
425
- this.context = this.$canvas.getContext('2d');
426
- this.resize(this.canvasConfig.width, this.canvasConfig.height);
427
- case 4:
428
- case "end":
429
- return _context.stop();
430
- }
423
+ }
424
+ this.context = this.$canvas.getContext('2d');
425
+ this.resize(this.canvasConfig.width, this.canvasConfig.height);
426
+ case 4:
427
+ case "end":
428
+ return _context.stop();
431
429
  }
432
430
  }, _callee, this);
433
431
  }));
@@ -487,18 +485,16 @@ var Canvas2DContextService = /*#__PURE__*/function () {
487
485
  var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
488
486
  var _options, type, encoderOptions;
489
487
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
490
- while (1) {
491
- switch (_context2.prev = _context2.next) {
492
- case 0:
493
- if (options === void 0) {
494
- options = {};
495
- }
496
- _options = options, type = _options.type, encoderOptions = _options.encoderOptions;
497
- return _context2.abrupt("return", this.context.canvas.toDataURL(type, encoderOptions));
498
- case 3:
499
- case "end":
500
- return _context2.stop();
501
- }
488
+ while (1) switch (_context2.prev = _context2.next) {
489
+ case 0:
490
+ if (options === void 0) {
491
+ options = {};
492
+ }
493
+ _options = options, type = _options.type, encoderOptions = _options.encoderOptions;
494
+ return _context2.abrupt("return", this.context.canvas.toDataURL(type, encoderOptions));
495
+ case 3:
496
+ case "end":
497
+ return _context2.stop();
502
498
  }
503
499
  }, _callee2, this);
504
500
  }));