@visactor/vrender 0.16.2 → 0.16.3

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/cjs/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const version = "0.16.2";
1
+ export declare const version = "0.16.3";
2
2
  export * from '@visactor/vrender-core';
3
3
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,5 +21,5 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "0.16.2", (0, vrender_kits_1.loadAllModule)(vrender_core_1.container),
24
+ exports.version = "0.16.3", (0, vrender_kits_1.loadAllModule)(vrender_core_1.container),
25
25
  __exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.2\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.3\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/dist/index.js CHANGED
@@ -2818,26 +2818,41 @@
2818
2818
  key: "supportEvent",
2819
2819
  get: function get() {
2820
2820
  return this._env || this.setEnv("browser"), this.envContribution.supportEvent;
2821
+ },
2822
+ set: function set(support) {
2823
+ this._env || this.setEnv("browser"), this.envContribution.supportEvent = support;
2821
2824
  }
2822
2825
  }, {
2823
2826
  key: "supportsTouchEvents",
2824
2827
  get: function get() {
2825
2828
  return this._env || this.setEnv("browser"), this.envContribution.supportsTouchEvents;
2829
+ },
2830
+ set: function set(support) {
2831
+ this._env || this.setEnv("browser"), this.envContribution.supportsTouchEvents = support;
2826
2832
  }
2827
2833
  }, {
2828
2834
  key: "supportsPointerEvents",
2829
2835
  get: function get() {
2830
2836
  return this._env || this.setEnv("browser"), this.envContribution.supportsPointerEvents;
2837
+ },
2838
+ set: function set(support) {
2839
+ this._env || this.setEnv("browser"), this.envContribution.supportsPointerEvents = support;
2831
2840
  }
2832
2841
  }, {
2833
2842
  key: "supportsMouseEvents",
2834
2843
  get: function get() {
2835
2844
  return this._env || this.setEnv("browser"), this.envContribution.supportsMouseEvents;
2845
+ },
2846
+ set: function set(support) {
2847
+ this._env || this.setEnv("browser"), this.envContribution.supportsMouseEvents = support;
2836
2848
  }
2837
2849
  }, {
2838
2850
  key: "applyStyles",
2839
2851
  get: function get() {
2840
2852
  return this._env || this.setEnv("browser"), this.envContribution.applyStyles;
2853
+ },
2854
+ set: function set(support) {
2855
+ this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
2841
2856
  }
2842
2857
  }, {
2843
2858
  key: "bindContribution",
@@ -5544,10 +5559,10 @@
5544
5559
  value: function lineEnd() {
5545
5560
  switch (this._point) {
5546
5561
  case 2:
5547
- this.context.lineTo(this._x1, this._y1, !1 !== this._lastDefined2, this.lastPoint1);
5562
+ this.context.lineTo(this._x1, this._y1, !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
5548
5563
  break;
5549
5564
  case 3:
5550
- _point(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined2, this.lastPoint1);
5565
+ _point(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
5551
5566
  }
5552
5567
  (this._line || 0 !== this._line && 1 === this._point) && this.context.closePath(), this._line = 1 - this._line;
5553
5568
  }
@@ -8367,12 +8382,12 @@
8367
8382
  key: "mapEvent",
8368
8383
  value: function mapEvent(e) {
8369
8384
  var _this$_prePointTarget;
8370
- var _a, _b, _c, _d, _e;
8385
+ var _a, _b, _c, _d, _e, _f, _g;
8371
8386
  if (!this.rootTarget) return;
8372
8387
  var mappers = this.mappingTable[e.type];
8373
8388
  var target;
8374
8389
  var cacheKey = "".concat(e.canvasX, "-").concat(e.canvasY);
8375
- if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage.renderCount) === (null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = (_this$_prePointTarget = {}, _defineProperty(_this$_prePointTarget, cacheKey, target), _defineProperty(_this$_prePointTarget, "stageRenderCount", null !== (_e = null == target ? void 0 : target.stage.renderCount) && void 0 !== _e ? _e : -1), _this$_prePointTarget))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else console.warn("[EventManager]: Event mapping not defined for ".concat(e.type));
8390
+ if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = (_this$_prePointTarget = {}, _defineProperty(_this$_prePointTarget, cacheKey, target), _defineProperty(_this$_prePointTarget, "stageRenderCount", null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1), _this$_prePointTarget))), mappers) for (var i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else console.warn("[EventManager]: Event mapping not defined for ".concat(e.type));
8376
8391
  }
8377
8392
  }, {
8378
8393
  key: "propagate",
@@ -11564,6 +11579,9 @@
11564
11579
  return ColorStore.Get(fromColor, exports.ColorType.Color255, _fromColorRGB), ColorStore.Get(toColor, exports.ColorType.Color255, _toColorRGB), "rgba(".concat(Math.round(_fromColorRGB[0] + (_toColorRGB[0] - _fromColorRGB[0]) * ratio), ",").concat(Math.round(_fromColorRGB[1] + (_toColorRGB[1] - _fromColorRGB[1]) * ratio), ",").concat(Math.round(_fromColorRGB[2] + (_toColorRGB[2] - _fromColorRGB[2]) * ratio), ",").concat(_fromColorRGB[3] + (_toColorRGB[3] - _fromColorRGB[3]) * ratio, ")");
11565
11580
  }
11566
11581
 
11582
+ Object.keys(DEFAULT_COLORS).forEach(function (k) {
11583
+ });
11584
+
11567
11585
  var interpolateOtherAttrs = function interpolateOtherAttrs(attrs, out, ratio) {
11568
11586
  attrs.forEach(function (entry) {
11569
11587
  if (Number.isFinite(entry.to)) out[entry.key] = entry.from + (entry.to - entry.from) * ratio;else if ("fill" === entry.key || "stroke" === entry.key) {
@@ -25250,6 +25268,11 @@
25250
25268
  return new Stage(params);
25251
25269
  }
25252
25270
 
25271
+ var params;
25272
+ !function (params) {
25273
+ params[params.W = 1] = "W", params[params.H = 2] = "H", params[params.WH = 3] = "WH";
25274
+ }(params || (params = {}));
25275
+
25253
25276
  var strCommandMap = ["arc", "arcTo", "bezierCurveTo", "closePath", "ellipse", "lineTo", "moveTo", "quadraticCurveTo", "rect"];
25254
25277
 
25255
25278
  var __decorate$10 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -25991,7 +26014,11 @@
25991
26014
  }, {
25992
26015
  key: "containsPoint",
25993
26016
  value: function containsPoint(graphic, point, params) {
25994
- return !!this.pickItem(graphic, point, null, params);
26017
+ var _a;
26018
+ return !!(null === (_a = this.pickItem(graphic, point, null, null != params ? params : {
26019
+ pickContext: this.pickContext,
26020
+ pickerService: this
26021
+ })) || void 0 === _a ? void 0 : _a.graphic);
25995
26022
  }
25996
26023
  }, {
25997
26024
  key: "pickGroup",
@@ -29822,7 +29849,8 @@
29822
29849
  height: domref.height,
29823
29850
  width: domref.width
29824
29851
  };
29825
- }
29852
+ },
29853
+ nativeCanvas: _canvas
29826
29854
  };
29827
29855
  canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
29828
29856
  });
@@ -33312,6 +33340,12 @@
33312
33340
  value: function init() {
33313
33341
  this._context = new LynxContext2d(this, this._dpr);
33314
33342
  }
33343
+ }, {
33344
+ key: "resize",
33345
+ value: function resize(width, height) {
33346
+ this._pixelWidth = width * this._dpr, this._pixelHeight = height * this._dpr, this._displayWidth = width, this._displayHeight = height, this._nativeCanvas.width = this._pixelWidth, this._nativeCanvas.height = this._pixelHeight, this._nativeCanvas.nativeCanvas && (this._nativeCanvas.nativeCanvas.width = this._pixelWidth, this._nativeCanvas.nativeCanvas.height = this._pixelHeight);
33347
+ this._context.dpr = this._dpr;
33348
+ }
33315
33349
  }, {
33316
33350
  key: "release",
33317
33351
  value: function release() {}
@@ -33449,7 +33483,9 @@
33449
33483
  value: function releaseWindow() {}
33450
33484
  }, {
33451
33485
  key: "resizeWindow",
33452
- value: function resizeWindow(width, height) {}
33486
+ value: function resizeWindow(width, height) {
33487
+ this.canvas.resize(width, height);
33488
+ }
33453
33489
  }, {
33454
33490
  key: "setDpr",
33455
33491
  value: function setDpr(dpr) {
@@ -34427,7 +34463,7 @@
34427
34463
 
34428
34464
  var roughModule = _roughModule;
34429
34465
 
34430
- const version = "0.16.2";
34466
+ const version = "0.16.3";
34431
34467
  loadAllModule(container);
34432
34468
 
34433
34469
  exports.ACustomAnimate = ACustomAnimate;