@visactor/vrender 0.17.11 → 0.17.12-alpha.2
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 +1 -1
- package/cjs/index.js +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.js +15 -46
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,13 +21,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.17.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, vrender_kits_2.
|
|
28
|
-
(0, vrender_kits_2.
|
|
29
|
-
(0, vrender_kits_2.
|
|
30
|
-
(0, vrender_kits_2.
|
|
31
|
-
vrender_kits_2.
|
|
32
|
-
(0, vrender_kits_2.
|
|
33
|
-
|
|
24
|
+
exports.version = "0.17.12-alpha.2", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
|
+
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
|
+
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
|
+
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
|
28
|
+
(0, vrender_kits_2.registerCircle)(), (0, vrender_kits_2.registerGlyph)(), (0, vrender_kits_2.registerGroup)(),
|
|
29
|
+
(0, vrender_kits_2.registerImage)(), (0, vrender_kits_2.registerLine)(), (0, vrender_kits_2.registerPath)(),
|
|
30
|
+
(0, vrender_kits_2.registerPolygon)(), (0, vrender_kits_2.registerPyramid3d)(),
|
|
31
|
+
(0, vrender_kits_2.registerRect)(), (0, vrender_kits_2.registerRect3d)(), (0, vrender_kits_2.registerRichtext)(),
|
|
32
|
+
(0, vrender_kits_2.registerShadowRoot)(), (0, vrender_kits_2.registerSymbol)(),
|
|
33
|
+
(0, vrender_kits_2.registerText)(), (0, vrender_kits_2.registerWrapText)(), __exportStar(require("@visactor/vrender-core"), exports),
|
|
34
|
+
__exportStar(require("@visactor/vrender-kits"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.17.12-alpha.2\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -5163,7 +5163,6 @@
|
|
|
5163
5163
|
textureSize: 10,
|
|
5164
5164
|
texturePadding: 2,
|
|
5165
5165
|
backgroundMode: "no-repeat",
|
|
5166
|
-
backgroundFit: !0,
|
|
5167
5166
|
blur: 0,
|
|
5168
5167
|
cursor: null,
|
|
5169
5168
|
html: null
|
|
@@ -13789,12 +13788,10 @@
|
|
|
13789
13788
|
get: function get() {
|
|
13790
13789
|
var textTheme = getTheme(this).text,
|
|
13791
13790
|
attribute = this.attribute;
|
|
13792
|
-
if (this.
|
|
13791
|
+
if (!this.isSimplify()) return;
|
|
13793
13792
|
var _attribute$maxLineWid2 = attribute.maxLineWidth,
|
|
13794
13793
|
maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
|
|
13795
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(),
|
|
13796
|
-
return item.text;
|
|
13797
|
-
}).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
13794
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
13798
13795
|
}
|
|
13799
13796
|
}, {
|
|
13800
13797
|
key: "multilineLayout",
|
|
@@ -18455,9 +18452,7 @@
|
|
|
18455
18452
|
var _graphic$attribute = graphic.attribute,
|
|
18456
18453
|
background = _graphic$attribute.background,
|
|
18457
18454
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18458
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
18459
|
-
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
18460
|
-
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18455
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
|
|
18461
18456
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18462
18457
|
var res = graphic.resources.get(background);
|
|
18463
18458
|
if ("success" !== res.state || !res.data) return;
|
|
@@ -18472,35 +18467,15 @@
|
|
|
18472
18467
|
}
|
|
18473
18468
|
context.clip();
|
|
18474
18469
|
var b = graphic.AABBBounds;
|
|
18475
|
-
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode
|
|
18470
|
+
context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18476
18471
|
} else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18477
18472
|
}
|
|
18478
18473
|
}, {
|
|
18479
18474
|
key: "doDrawImage",
|
|
18480
|
-
value: function doDrawImage(context, data, b, backgroundMode
|
|
18475
|
+
value: function doDrawImage(context, data, b, backgroundMode) {
|
|
18481
18476
|
if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height());else {
|
|
18482
|
-
var targetW = b.width(),
|
|
18483
|
-
targetH = b.height();
|
|
18484
|
-
var w = targetW,
|
|
18485
|
-
h = targetH;
|
|
18486
|
-
if (backgroundFit && "repeat" !== backgroundMode && (data.width || data.height)) {
|
|
18487
|
-
var resW = data.width,
|
|
18488
|
-
resH = data.height;
|
|
18489
|
-
if ("repeat-x" === backgroundMode) {
|
|
18490
|
-
w = resW * (targetH / resH);
|
|
18491
|
-
} else if ("repeat-y" === backgroundMode) {
|
|
18492
|
-
h = resH * (targetW / resW);
|
|
18493
|
-
}
|
|
18494
|
-
var canvas = canvasAllocate.allocate({
|
|
18495
|
-
width: w,
|
|
18496
|
-
height: h,
|
|
18497
|
-
dpr: context.dpr
|
|
18498
|
-
}),
|
|
18499
|
-
ctx = canvas.getContext("2d");
|
|
18500
|
-
ctx && (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, w, h), ctx.drawImage(data, 0, 0, w, h), data = canvas.nativeCanvas), document.body.appendChild(data), canvasAllocate.free(canvas);
|
|
18501
|
-
}
|
|
18502
18477
|
var pattern = context.createPattern(data, backgroundMode);
|
|
18503
|
-
context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0,
|
|
18478
|
+
context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, b.width(), b.height()), context.translate(-b.x1, -b.y1);
|
|
18504
18479
|
}
|
|
18505
18480
|
}
|
|
18506
18481
|
}]);
|
|
@@ -18824,15 +18799,13 @@
|
|
|
18824
18799
|
var _graphic$attribute = graphic.attribute,
|
|
18825
18800
|
background = _graphic$attribute.background,
|
|
18826
18801
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18827
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
18828
|
-
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
18829
|
-
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18802
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
|
|
18830
18803
|
if (background) if (graphic.backgroundImg && graphic.resources) {
|
|
18831
18804
|
var res = graphic.resources.get(background);
|
|
18832
18805
|
if ("success" !== res.state || !res.data) return;
|
|
18833
18806
|
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
|
|
18834
18807
|
var b = graphic.AABBBounds;
|
|
18835
|
-
this.doDrawImage(context, res.data, b, backgroundMode
|
|
18808
|
+
this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
18836
18809
|
} else context.highPerformanceSave(), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
|
|
18837
18810
|
}
|
|
18838
18811
|
}]);
|
|
@@ -18914,9 +18887,7 @@
|
|
|
18914
18887
|
var _graphic$attribute = graphic.attribute,
|
|
18915
18888
|
background = _graphic$attribute.background,
|
|
18916
18889
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
18917
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
18918
|
-
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
18919
|
-
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
18890
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
|
|
18920
18891
|
if (background) if (graphic.backgroundImg) {
|
|
18921
18892
|
var res = graphic.resources.get(background);
|
|
18922
18893
|
if ("success" !== res.state || !res.data) return;
|
|
@@ -18930,7 +18901,7 @@
|
|
|
18930
18901
|
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
18931
18902
|
}
|
|
18932
18903
|
var b = graphic.AABBBounds;
|
|
18933
|
-
this.doDrawImage(context, res.data, b, backgroundMode
|
|
18904
|
+
this.doDrawImage(context, res.data, b, backgroundMode), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
18934
18905
|
} else if (isObject$1(background)) {
|
|
18935
18906
|
var stroke = background.stroke,
|
|
18936
18907
|
fill = background.fill,
|
|
@@ -20406,15 +20377,13 @@
|
|
|
20406
20377
|
var _graphic$attribute = graphic.attribute,
|
|
20407
20378
|
background = _graphic$attribute.background,
|
|
20408
20379
|
_graphic$attribute$ba = _graphic$attribute.backgroundMode,
|
|
20409
|
-
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba
|
|
20410
|
-
_graphic$attribute$ba2 = _graphic$attribute.backgroundFit,
|
|
20411
|
-
backgroundFit = _graphic$attribute$ba2 === void 0 ? graphicAttribute.backgroundFit : _graphic$attribute$ba2;
|
|
20380
|
+
backgroundMode = _graphic$attribute$ba === void 0 ? graphicAttribute.backgroundMode : _graphic$attribute$ba;
|
|
20412
20381
|
if (!background) return;
|
|
20413
20382
|
var b = graphic.AABBBounds;
|
|
20414
20383
|
if (graphic.backgroundImg && graphic.resources) {
|
|
20415
20384
|
var res = graphic.resources.get(background);
|
|
20416
20385
|
if ("success" !== res.state || !res.data) return;
|
|
20417
|
-
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode
|
|
20386
|
+
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), this.doDrawImage(context, res.data, b, backgroundMode), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
20418
20387
|
} else context.highPerformanceSave(), context.fillStyle = background, context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
20419
20388
|
}
|
|
20420
20389
|
}]);
|
|
@@ -22935,10 +22904,10 @@
|
|
|
22935
22904
|
var left = 0,
|
|
22936
22905
|
top = 0;
|
|
22937
22906
|
if ("position" === anchorType) {
|
|
22938
|
-
var matrix = graphic.
|
|
22907
|
+
var matrix = graphic.transMatrix;
|
|
22939
22908
|
left = matrix.e, top = matrix.f;
|
|
22940
22909
|
} else {
|
|
22941
|
-
var b = graphic.
|
|
22910
|
+
var b = graphic.AABBBounds;
|
|
22942
22911
|
left = b.x1, top = b.y1;
|
|
22943
22912
|
}
|
|
22944
22913
|
var containerTL = application.global.getElementTopLeft(nativeContainer, !1),
|
|
@@ -34481,7 +34450,7 @@
|
|
|
34481
34450
|
|
|
34482
34451
|
var roughModule = _roughModule;
|
|
34483
34452
|
|
|
34484
|
-
const version = "0.17.
|
|
34453
|
+
const version = "0.17.12-alpha.2";
|
|
34485
34454
|
preLoadAllModule();
|
|
34486
34455
|
if (isBrowserEnv()) {
|
|
34487
34456
|
loadBrowserEnv(container);
|