@visactor/vrender 1.0.46-alpha.1 → 1.0.46-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 +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +40 -11
- package/dist/index.js +40 -11
- 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 +7 -7
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ 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"), vrender_animate_1 = require("@visactor/vrender-animate");
|
|
23
23
|
|
|
24
|
-
exports.version = "1.0.46-alpha.
|
|
24
|
+
exports.version = "1.0.46-alpha.2", (0, vrender_core_1.preLoadAllModule)(), (0,
|
|
25
25
|
vrender_core_1.isBrowserEnv)() ? (0, vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0,
|
|
26
26
|
vrender_core_1.isNodeEnv)() && (0, vrender_kits_1.loadNodeEnv)(vrender_core_1.container),
|
|
27
27
|
(0, vrender_kits_2.registerArc)(), (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,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,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } 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';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.46-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAmF;AACnF,yDAmBgC;AAChC,+DAAmF;AAEtE,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,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,IAAA,2BAAY,GAAE,CAAC;AAEf,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AAEtB,IAAA,uCAAqB,GAAE,CAAC;AACxB,IAAA,iCAAe,GAAE,CAAC;AAElB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAG7C,6DAAkD;AAAzC,wGAAA,KAAK,OAAA;AACd,uDAAmD;AAA1C,yGAAA,SAAS,OAAA","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv, registerStar } 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';\nimport { registerCustomAnimate, registerAnimate } from '@visactor/vrender-animate';\n// 导出版本号\nexport const version = \"1.0.46-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();\nregisterStar();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\n\nregisterCustomAnimate();\nregisterAnimate();\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction } from '@visactor/vrender-core';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -14171,13 +14171,14 @@ class DefaultBaseTextureRenderContribution {
|
|
|
14171
14171
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
14172
14172
|
}
|
|
14173
14173
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
14174
|
-
var _a, _b, _c, _d, _e;
|
|
14174
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14175
14175
|
const {
|
|
14176
14176
|
textureRatio = graphicAttribute.textureRatio,
|
|
14177
14177
|
textureOptions = null
|
|
14178
14178
|
} = graphic.attribute;
|
|
14179
14179
|
let pattern = null;
|
|
14180
|
-
const
|
|
14180
|
+
const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
|
|
14181
|
+
patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
|
|
14181
14182
|
if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
|
|
14182
14183
|
if ("string" == typeof texture) switch (texture) {
|
|
14183
14184
|
case "circle":
|
|
@@ -14204,7 +14205,7 @@ class DefaultBaseTextureRenderContribution {
|
|
|
14204
14205
|
case "grid":
|
|
14205
14206
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
14206
14207
|
}
|
|
14207
|
-
pattern || (pattern = this.createResourcePattern(texture, graphic, context)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
14208
|
+
pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
14208
14209
|
}
|
|
14209
14210
|
if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
|
|
14210
14211
|
const {
|
|
@@ -14251,19 +14252,19 @@ class DefaultBaseTextureRenderContribution {
|
|
|
14251
14252
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
14252
14253
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
14253
14254
|
_y = y + cellSize / 2 + i * cellSize;
|
|
14254
|
-
null === (
|
|
14255
|
+
null === (_b = textureOptions.beforeDynamicTexture) || void 0 === _b || _b.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
|
|
14255
14256
|
}
|
|
14256
14257
|
useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
|
|
14257
14258
|
} else if (pattern) {
|
|
14258
14259
|
if (pattern.setTransform) {
|
|
14259
14260
|
const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
|
|
14260
|
-
alignOffsetX = null !== (
|
|
14261
|
-
alignOffsetY = null !== (
|
|
14261
|
+
alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
|
|
14262
|
+
alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
|
|
14262
14263
|
let translateX = 0,
|
|
14263
14264
|
translateY = 0;
|
|
14264
14265
|
if (alignToGraphic) {
|
|
14265
14266
|
const m = context.currentMatrix;
|
|
14266
|
-
translateX = (null !== (
|
|
14267
|
+
translateX = (null !== (_e = null == m ? void 0 : m.e) && void 0 !== _e ? _e : 0) + x + alignOffsetX, translateY = (null !== (_f = null == m ? void 0 : m.f) && void 0 !== _f ? _f : 0) + y + alignOffsetY;
|
|
14267
14268
|
} else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
|
|
14268
14269
|
pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
|
|
14269
14270
|
}
|
|
@@ -14276,14 +14277,42 @@ class DefaultBaseTextureRenderContribution {
|
|
|
14276
14277
|
}), x + b.x1 - x, y + b.y1 - y), context.restore();
|
|
14277
14278
|
}
|
|
14278
14279
|
}
|
|
14279
|
-
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr) {
|
|
14280
|
-
return "string" != typeof texture ? texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
|
|
14280
|
+
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
|
|
14281
|
+
return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
|
|
14281
14282
|
}
|
|
14282
|
-
createResourcePattern(texture, graphic, context) {
|
|
14283
|
+
createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
|
|
14283
14284
|
var _a;
|
|
14284
14285
|
const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
|
|
14285
14286
|
data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
|
|
14286
14287
|
if (!data) return null;
|
|
14288
|
+
if (texturePadding > 0 || textureRadius > 0) {
|
|
14289
|
+
const w = data.naturalWidth || data.width,
|
|
14290
|
+
h = data.naturalHeight || data.height;
|
|
14291
|
+
if (w > 0 && h > 0) {
|
|
14292
|
+
const tileW = w + 2 * texturePadding,
|
|
14293
|
+
tileH = h + 2 * texturePadding,
|
|
14294
|
+
canvas = canvasAllocate.allocate({
|
|
14295
|
+
width: tileW,
|
|
14296
|
+
height: tileH,
|
|
14297
|
+
dpr: context.dpr
|
|
14298
|
+
}),
|
|
14299
|
+
ctx = canvas.getContext("2d");
|
|
14300
|
+
if (ctx) {
|
|
14301
|
+
if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
|
|
14302
|
+
const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
|
|
14303
|
+
x0 = texturePadding,
|
|
14304
|
+
y0 = texturePadding,
|
|
14305
|
+
x1 = x0 + w,
|
|
14306
|
+
y1 = y0 + h;
|
|
14307
|
+
ctx.beginPath(), ctx.moveTo(x0 + r, y0), ctx.lineTo(x1 - r, y0), ctx.quadraticCurveTo(x1, y0, x1, y0 + r), ctx.lineTo(x1, y1 - r), ctx.quadraticCurveTo(x1, y1, x1 - r, y1), ctx.lineTo(x0 + r, y1), ctx.quadraticCurveTo(x0, y1, x0, y1 - r), ctx.lineTo(x0, y0 + r), ctx.quadraticCurveTo(x0, y0, x0 + r, y0), ctx.closePath(), ctx.clip();
|
|
14308
|
+
}
|
|
14309
|
+
ctx.drawImage(data, texturePadding, texturePadding, w, h);
|
|
14310
|
+
const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
|
|
14311
|
+
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), canvasAllocate.free(canvas), pattern;
|
|
14312
|
+
}
|
|
14313
|
+
canvasAllocate.free(canvas);
|
|
14314
|
+
}
|
|
14315
|
+
}
|
|
14287
14316
|
const pattern = context.createPattern(data, "repeat");
|
|
14288
14317
|
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
|
|
14289
14318
|
}
|
|
@@ -52963,7 +52992,7 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
52963
52992
|
select: !0
|
|
52964
52993
|
};
|
|
52965
52994
|
|
|
52966
|
-
const version = "1.0.46-alpha.
|
|
52995
|
+
const version = "1.0.46-alpha.2";
|
|
52967
52996
|
preLoadAllModule();
|
|
52968
52997
|
if (isBrowserEnv()) {
|
|
52969
52998
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -14177,13 +14177,14 @@
|
|
|
14177
14177
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
14178
14178
|
}
|
|
14179
14179
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
14180
|
-
var _a, _b, _c, _d, _e;
|
|
14180
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14181
14181
|
const {
|
|
14182
14182
|
textureRatio = graphicAttribute.textureRatio,
|
|
14183
14183
|
textureOptions = null
|
|
14184
14184
|
} = graphic.attribute;
|
|
14185
14185
|
let pattern = null;
|
|
14186
|
-
const
|
|
14186
|
+
const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
|
|
14187
|
+
patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
|
|
14187
14188
|
if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
|
|
14188
14189
|
if ("string" == typeof texture) switch (texture) {
|
|
14189
14190
|
case "circle":
|
|
@@ -14210,7 +14211,7 @@
|
|
|
14210
14211
|
case "grid":
|
|
14211
14212
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
14212
14213
|
}
|
|
14213
|
-
pattern || (pattern = this.createResourcePattern(texture, graphic, context)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
14214
|
+
pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
|
|
14214
14215
|
}
|
|
14215
14216
|
if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
|
|
14216
14217
|
const {
|
|
@@ -14257,19 +14258,19 @@
|
|
|
14257
14258
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
14258
14259
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
14259
14260
|
_y = y + cellSize / 2 + i * cellSize;
|
|
14260
|
-
null === (
|
|
14261
|
+
null === (_b = textureOptions.beforeDynamicTexture) || void 0 === _b || _b.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
|
|
14261
14262
|
}
|
|
14262
14263
|
useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
|
|
14263
14264
|
} else if (pattern) {
|
|
14264
14265
|
if (pattern.setTransform) {
|
|
14265
14266
|
const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
|
|
14266
|
-
alignOffsetX = null !== (
|
|
14267
|
-
alignOffsetY = null !== (
|
|
14267
|
+
alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
|
|
14268
|
+
alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
|
|
14268
14269
|
let translateX = 0,
|
|
14269
14270
|
translateY = 0;
|
|
14270
14271
|
if (alignToGraphic) {
|
|
14271
14272
|
const m = context.currentMatrix;
|
|
14272
|
-
translateX = (null !== (
|
|
14273
|
+
translateX = (null !== (_e = null == m ? void 0 : m.e) && void 0 !== _e ? _e : 0) + x + alignOffsetX, translateY = (null !== (_f = null == m ? void 0 : m.f) && void 0 !== _f ? _f : 0) + y + alignOffsetY;
|
|
14273
14274
|
} else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
|
|
14274
14275
|
pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
|
|
14275
14276
|
}
|
|
@@ -14282,14 +14283,42 @@
|
|
|
14282
14283
|
}), x + b.x1 - x, y + b.y1 - y), context.restore();
|
|
14283
14284
|
}
|
|
14284
14285
|
}
|
|
14285
|
-
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr) {
|
|
14286
|
-
return "string" != typeof texture ? texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
|
|
14286
|
+
getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
|
|
14287
|
+
return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
|
|
14287
14288
|
}
|
|
14288
|
-
createResourcePattern(texture, graphic, context) {
|
|
14289
|
+
createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
|
|
14289
14290
|
var _a;
|
|
14290
14291
|
const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
|
|
14291
14292
|
data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
|
|
14292
14293
|
if (!data) return null;
|
|
14294
|
+
if (texturePadding > 0 || textureRadius > 0) {
|
|
14295
|
+
const w = data.naturalWidth || data.width,
|
|
14296
|
+
h = data.naturalHeight || data.height;
|
|
14297
|
+
if (w > 0 && h > 0) {
|
|
14298
|
+
const tileW = w + 2 * texturePadding,
|
|
14299
|
+
tileH = h + 2 * texturePadding,
|
|
14300
|
+
canvas = canvasAllocate.allocate({
|
|
14301
|
+
width: tileW,
|
|
14302
|
+
height: tileH,
|
|
14303
|
+
dpr: context.dpr
|
|
14304
|
+
}),
|
|
14305
|
+
ctx = canvas.getContext("2d");
|
|
14306
|
+
if (ctx) {
|
|
14307
|
+
if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
|
|
14308
|
+
const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
|
|
14309
|
+
x0 = texturePadding,
|
|
14310
|
+
y0 = texturePadding,
|
|
14311
|
+
x1 = x0 + w,
|
|
14312
|
+
y1 = y0 + h;
|
|
14313
|
+
ctx.beginPath(), ctx.moveTo(x0 + r, y0), ctx.lineTo(x1 - r, y0), ctx.quadraticCurveTo(x1, y0, x1, y0 + r), ctx.lineTo(x1, y1 - r), ctx.quadraticCurveTo(x1, y1, x1 - r, y1), ctx.lineTo(x0 + r, y1), ctx.quadraticCurveTo(x0, y1, x0, y1 - r), ctx.lineTo(x0, y0 + r), ctx.quadraticCurveTo(x0, y0, x0 + r, y0), ctx.closePath(), ctx.clip();
|
|
14314
|
+
}
|
|
14315
|
+
ctx.drawImage(data, texturePadding, texturePadding, w, h);
|
|
14316
|
+
const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
|
|
14317
|
+
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), canvasAllocate.free(canvas), pattern;
|
|
14318
|
+
}
|
|
14319
|
+
canvasAllocate.free(canvas);
|
|
14320
|
+
}
|
|
14321
|
+
}
|
|
14293
14322
|
const pattern = context.createPattern(data, "repeat");
|
|
14294
14323
|
return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
|
|
14295
14324
|
}
|
|
@@ -52969,7 +52998,7 @@
|
|
|
52969
52998
|
select: !0
|
|
52970
52999
|
};
|
|
52971
53000
|
|
|
52972
|
-
const version = "1.0.46-alpha.
|
|
53001
|
+
const version = "1.0.46-alpha.2";
|
|
52973
53002
|
preLoadAllModule();
|
|
52974
53003
|
if (isBrowserEnv()) {
|
|
52975
53004
|
loadBrowserEnv(container);
|