@visactor/vrender 0.22.2 → 0.22.4
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 +39 -15
- package/dist/index.js +39 -15
- 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 +5 -5
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");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.22.
|
|
24
|
+
exports.version = "0.22.4", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
25
|
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
26
|
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
27
|
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,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;AAEnB,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;AACtB,yDAAuC;AACvC,yDAAuC","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 } 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.22.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,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;AAEnB,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;AACtB,yDAAuC;AACvC,yDAAuC","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 } 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.22.4\";\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();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -15622,6 +15622,7 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15622
15622
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
15623
15623
|
}
|
|
15624
15624
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
15625
|
+
var _a;
|
|
15625
15626
|
const {
|
|
15626
15627
|
textureRatio = graphicAttribute.textureRatio,
|
|
15627
15628
|
textureOptions = null
|
|
@@ -15653,12 +15654,32 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15653
15654
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
15654
15655
|
}
|
|
15655
15656
|
if (textureOptions && textureOptions.dynamicTexture) {
|
|
15656
|
-
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15657
15657
|
const {
|
|
15658
|
-
gridConfig = {}
|
|
15658
|
+
gridConfig = {},
|
|
15659
|
+
useNewCanvas: useNewCanvas
|
|
15659
15660
|
} = textureOptions,
|
|
15660
|
-
b = graphic.AABBBounds
|
|
15661
|
-
|
|
15661
|
+
b = graphic.AABBBounds;
|
|
15662
|
+
x = b.x1, y = b.y1;
|
|
15663
|
+
const originalContext = context;
|
|
15664
|
+
let newCanvas;
|
|
15665
|
+
if (useNewCanvas) {
|
|
15666
|
+
newCanvas = canvasAllocate.allocate({
|
|
15667
|
+
width: b.width(),
|
|
15668
|
+
height: b.height(),
|
|
15669
|
+
dpr: context.dpr
|
|
15670
|
+
});
|
|
15671
|
+
const ctx = newCanvas.getContext("2d");
|
|
15672
|
+
ctx.clearRect(0, 0, b.width(), b.height()), x = 0, y = 0, context = ctx;
|
|
15673
|
+
}
|
|
15674
|
+
if (originalContext.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
15675
|
+
const {
|
|
15676
|
+
scrollX = 0,
|
|
15677
|
+
scrollY = 0
|
|
15678
|
+
} = graphic.parent.attribute;
|
|
15679
|
+
originalContext.setTransformFromMatrix(graphic.parent.globalTransMatrix), originalContext.translate(scrollX, scrollY, !0);
|
|
15680
|
+
}
|
|
15681
|
+
originalContext.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), originalContext.clip();
|
|
15682
|
+
const width = b.width(),
|
|
15662
15683
|
height = b.height(),
|
|
15663
15684
|
padding = texturePadding,
|
|
15664
15685
|
cellSize = textureSize,
|
|
@@ -15677,9 +15698,9 @@ class DefaultBaseTextureRenderContribution {
|
|
|
15677
15698
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
15678
15699
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
15679
15700
|
_y = y + cellSize / 2 + i * cellSize;
|
|
15680
|
-
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);
|
|
15701
|
+
null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.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());
|
|
15681
15702
|
}
|
|
15682
|
-
|
|
15703
|
+
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();
|
|
15683
15704
|
} else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
|
|
15684
15705
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15685
15706
|
const b = graphic.AABBBounds;
|
|
@@ -20437,7 +20458,8 @@ function getDefaultCharacterConfig(attribute) {
|
|
|
20437
20458
|
stroke = !1,
|
|
20438
20459
|
fontWeight = "normal",
|
|
20439
20460
|
lineHeight: lineHeight,
|
|
20440
|
-
fontFamily = "Arial"
|
|
20461
|
+
fontFamily = "Arial",
|
|
20462
|
+
textAlign: textAlign
|
|
20441
20463
|
} = attribute;
|
|
20442
20464
|
let {
|
|
20443
20465
|
fontSize = 12
|
|
@@ -20448,7 +20470,8 @@ function getDefaultCharacterConfig(attribute) {
|
|
|
20448
20470
|
fontSize: fontSize,
|
|
20449
20471
|
fontWeight: fontWeight,
|
|
20450
20472
|
fontFamily: fontFamily,
|
|
20451
|
-
lineHeight: lineHeight
|
|
20473
|
+
lineHeight: lineHeight,
|
|
20474
|
+
textAlign: textAlign
|
|
20452
20475
|
};
|
|
20453
20476
|
}
|
|
20454
20477
|
function findConfigIndexByCursorIdx(textConfig, cursorIndex) {
|
|
@@ -20497,9 +20520,9 @@ class EditModule {
|
|
|
20497
20520
|
} else {
|
|
20498
20521
|
const configIdx = this.composingConfigIdx,
|
|
20499
20522
|
lastConfig = textConfig[configIdx] || textConfig[configIdx - 1];
|
|
20500
|
-
textConfig.splice(configIdx, 0, Object.assign(Object.assign({
|
|
20523
|
+
textConfig.splice(configIdx, 0, Object.assign(Object.assign(Object.assign({
|
|
20501
20524
|
fill: "black"
|
|
20502
|
-
}, lastConfig), {
|
|
20525
|
+
}, getDefaultCharacterConfig(this.currRt.attribute)), lastConfig), {
|
|
20503
20526
|
text: ""
|
|
20504
20527
|
}));
|
|
20505
20528
|
}
|
|
@@ -20893,6 +20916,7 @@ class RichTextEditPlugin {
|
|
|
20893
20916
|
boundsStrokeWhenInput: boundsStrokeWhenInput
|
|
20894
20917
|
} = editOptions;
|
|
20895
20918
|
if (!editOptions || !boundsStrokeWhenInput) return;
|
|
20919
|
+
this.offsetShadowRoot();
|
|
20896
20920
|
const b = this.getRichTextAABBBounds(this.currRt),
|
|
20897
20921
|
height = b.height(),
|
|
20898
20922
|
width = b.width();
|
|
@@ -20907,7 +20931,7 @@ class RichTextEditPlugin {
|
|
|
20907
20931
|
zIndex: -1
|
|
20908
20932
|
});
|
|
20909
20933
|
const shadow = this.getShadow(this.currRt);
|
|
20910
|
-
this.addEditLineOrBgOrBounds(this.shadowBounds, shadow), this.offsetLineBgAndShadowBounds()
|
|
20934
|
+
this.addEditLineOrBgOrBounds(this.shadowBounds, shadow), this.offsetLineBgAndShadowBounds();
|
|
20911
20935
|
}
|
|
20912
20936
|
trySyncPlaceholderToTextConfig() {
|
|
20913
20937
|
if (!this.currRt) return;
|
|
@@ -21170,8 +21194,8 @@ class RichTextEditPlugin {
|
|
|
21170
21194
|
getShadow(rt) {
|
|
21171
21195
|
const sr = rt.shadowRoot || rt.attachShadow();
|
|
21172
21196
|
return sr.setAttributes({
|
|
21173
|
-
width:
|
|
21174
|
-
height:
|
|
21197
|
+
width: 0,
|
|
21198
|
+
height: 0
|
|
21175
21199
|
}), sr;
|
|
21176
21200
|
}
|
|
21177
21201
|
getLineByPoint(cache, p1) {
|
|
@@ -25021,7 +25045,7 @@ class Gesture extends EventEmitter {
|
|
|
25021
25045
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25022
25046
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
25023
25047
|
super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
|
|
25024
|
-
this.
|
|
25048
|
+
this.startTime = clock.now();
|
|
25025
25049
|
const {
|
|
25026
25050
|
cachedEvents: cachedEvents,
|
|
25027
25051
|
startPoints: startPoints
|
|
@@ -31610,7 +31634,7 @@ function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic)
|
|
|
31610
31634
|
|
|
31611
31635
|
const roughModule = _roughModule;
|
|
31612
31636
|
|
|
31613
|
-
const version = "0.22.
|
|
31637
|
+
const version = "0.22.4";
|
|
31614
31638
|
preLoadAllModule();
|
|
31615
31639
|
if (isBrowserEnv()) {
|
|
31616
31640
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -15628,6 +15628,7 @@
|
|
|
15628
15628
|
texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
|
|
15629
15629
|
}
|
|
15630
15630
|
drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
|
|
15631
|
+
var _a;
|
|
15631
15632
|
const {
|
|
15632
15633
|
textureRatio = graphicAttribute.textureRatio,
|
|
15633
15634
|
textureOptions = null
|
|
@@ -15659,12 +15660,32 @@
|
|
|
15659
15660
|
pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
|
|
15660
15661
|
}
|
|
15661
15662
|
if (textureOptions && textureOptions.dynamicTexture) {
|
|
15662
|
-
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15663
15663
|
const {
|
|
15664
|
-
gridConfig = {}
|
|
15664
|
+
gridConfig = {},
|
|
15665
|
+
useNewCanvas: useNewCanvas
|
|
15665
15666
|
} = textureOptions,
|
|
15666
|
-
b = graphic.AABBBounds
|
|
15667
|
-
|
|
15667
|
+
b = graphic.AABBBounds;
|
|
15668
|
+
x = b.x1, y = b.y1;
|
|
15669
|
+
const originalContext = context;
|
|
15670
|
+
let newCanvas;
|
|
15671
|
+
if (useNewCanvas) {
|
|
15672
|
+
newCanvas = canvasAllocate.allocate({
|
|
15673
|
+
width: b.width(),
|
|
15674
|
+
height: b.height(),
|
|
15675
|
+
dpr: context.dpr
|
|
15676
|
+
});
|
|
15677
|
+
const ctx = newCanvas.getContext("2d");
|
|
15678
|
+
ctx.clearRect(0, 0, b.width(), b.height()), x = 0, y = 0, context = ctx;
|
|
15679
|
+
}
|
|
15680
|
+
if (originalContext.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
15681
|
+
const {
|
|
15682
|
+
scrollX = 0,
|
|
15683
|
+
scrollY = 0
|
|
15684
|
+
} = graphic.parent.attribute;
|
|
15685
|
+
originalContext.setTransformFromMatrix(graphic.parent.globalTransMatrix), originalContext.translate(scrollX, scrollY, !0);
|
|
15686
|
+
}
|
|
15687
|
+
originalContext.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), originalContext.clip();
|
|
15688
|
+
const width = b.width(),
|
|
15668
15689
|
height = b.height(),
|
|
15669
15690
|
padding = texturePadding,
|
|
15670
15691
|
cellSize = textureSize,
|
|
@@ -15683,9 +15704,9 @@
|
|
|
15683
15704
|
for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
|
|
15684
15705
|
const _x = x + cellSize / 2 + j * cellSize,
|
|
15685
15706
|
_y = y + cellSize / 2 + i * cellSize;
|
|
15686
|
-
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);
|
|
15707
|
+
null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.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());
|
|
15687
15708
|
}
|
|
15688
|
-
|
|
15709
|
+
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();
|
|
15689
15710
|
} else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
|
|
15690
15711
|
context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
|
|
15691
15712
|
const b = graphic.AABBBounds;
|
|
@@ -20443,7 +20464,8 @@
|
|
|
20443
20464
|
stroke = !1,
|
|
20444
20465
|
fontWeight = "normal",
|
|
20445
20466
|
lineHeight: lineHeight,
|
|
20446
|
-
fontFamily = "Arial"
|
|
20467
|
+
fontFamily = "Arial",
|
|
20468
|
+
textAlign: textAlign
|
|
20447
20469
|
} = attribute;
|
|
20448
20470
|
let {
|
|
20449
20471
|
fontSize = 12
|
|
@@ -20454,7 +20476,8 @@
|
|
|
20454
20476
|
fontSize: fontSize,
|
|
20455
20477
|
fontWeight: fontWeight,
|
|
20456
20478
|
fontFamily: fontFamily,
|
|
20457
|
-
lineHeight: lineHeight
|
|
20479
|
+
lineHeight: lineHeight,
|
|
20480
|
+
textAlign: textAlign
|
|
20458
20481
|
};
|
|
20459
20482
|
}
|
|
20460
20483
|
function findConfigIndexByCursorIdx(textConfig, cursorIndex) {
|
|
@@ -20503,9 +20526,9 @@
|
|
|
20503
20526
|
} else {
|
|
20504
20527
|
const configIdx = this.composingConfigIdx,
|
|
20505
20528
|
lastConfig = textConfig[configIdx] || textConfig[configIdx - 1];
|
|
20506
|
-
textConfig.splice(configIdx, 0, Object.assign(Object.assign({
|
|
20529
|
+
textConfig.splice(configIdx, 0, Object.assign(Object.assign(Object.assign({
|
|
20507
20530
|
fill: "black"
|
|
20508
|
-
}, lastConfig), {
|
|
20531
|
+
}, getDefaultCharacterConfig(this.currRt.attribute)), lastConfig), {
|
|
20509
20532
|
text: ""
|
|
20510
20533
|
}));
|
|
20511
20534
|
}
|
|
@@ -20899,6 +20922,7 @@
|
|
|
20899
20922
|
boundsStrokeWhenInput: boundsStrokeWhenInput
|
|
20900
20923
|
} = editOptions;
|
|
20901
20924
|
if (!editOptions || !boundsStrokeWhenInput) return;
|
|
20925
|
+
this.offsetShadowRoot();
|
|
20902
20926
|
const b = this.getRichTextAABBBounds(this.currRt),
|
|
20903
20927
|
height = b.height(),
|
|
20904
20928
|
width = b.width();
|
|
@@ -20913,7 +20937,7 @@
|
|
|
20913
20937
|
zIndex: -1
|
|
20914
20938
|
});
|
|
20915
20939
|
const shadow = this.getShadow(this.currRt);
|
|
20916
|
-
this.addEditLineOrBgOrBounds(this.shadowBounds, shadow), this.offsetLineBgAndShadowBounds()
|
|
20940
|
+
this.addEditLineOrBgOrBounds(this.shadowBounds, shadow), this.offsetLineBgAndShadowBounds();
|
|
20917
20941
|
}
|
|
20918
20942
|
trySyncPlaceholderToTextConfig() {
|
|
20919
20943
|
if (!this.currRt) return;
|
|
@@ -21176,8 +21200,8 @@
|
|
|
21176
21200
|
getShadow(rt) {
|
|
21177
21201
|
const sr = rt.shadowRoot || rt.attachShadow();
|
|
21178
21202
|
return sr.setAttributes({
|
|
21179
|
-
width:
|
|
21180
|
-
height:
|
|
21203
|
+
width: 0,
|
|
21204
|
+
height: 0
|
|
21181
21205
|
}), sr;
|
|
21182
21206
|
}
|
|
21183
21207
|
getLineByPoint(cache, p1) {
|
|
@@ -25027,7 +25051,7 @@
|
|
|
25027
25051
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25028
25052
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
25029
25053
|
super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
|
|
25030
|
-
this.
|
|
25054
|
+
this.startTime = clock.now();
|
|
25031
25055
|
const {
|
|
25032
25056
|
cachedEvents: cachedEvents,
|
|
25033
25057
|
startPoints: startPoints
|
|
@@ -31616,7 +31640,7 @@
|
|
|
31616
31640
|
|
|
31617
31641
|
const roughModule = _roughModule;
|
|
31618
31642
|
|
|
31619
|
-
const version = "0.22.
|
|
31643
|
+
const version = "0.22.4";
|
|
31620
31644
|
preLoadAllModule();
|
|
31621
31645
|
if (isBrowserEnv()) {
|
|
31622
31646
|
loadBrowserEnv(container);
|