@visactor/vrender 0.21.0-alpha.6 → 0.21.0-alpha.8
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 +26 -10
- package/dist/index.js +26 -10
- 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 +6 -6
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.21.0-alpha.
|
|
24
|
+
exports.version = "0.21.0-alpha.8", (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,yDAAqE;AACrE,yDAmBgC;AAEnB,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;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.21.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,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;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.21.0-alpha.8\";\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
|
@@ -1703,7 +1703,9 @@ class TextMeasure {
|
|
|
1703
1703
|
} = this.textSpec;
|
|
1704
1704
|
return {
|
|
1705
1705
|
width: metrics.width,
|
|
1706
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
1706
|
+
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
1707
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
1708
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
1707
1709
|
};
|
|
1708
1710
|
}
|
|
1709
1711
|
quickMeasure(text) {
|
|
@@ -1717,7 +1719,7 @@ class TextMeasure {
|
|
|
1717
1719
|
for (let i = 0; i < text.length; i++) {
|
|
1718
1720
|
const char = text[i];
|
|
1719
1721
|
let size = this._measureSpecialChar(char);
|
|
1720
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
1722
|
+
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height), !isNil$1(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$1(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
1721
1723
|
}
|
|
1722
1724
|
return totalSize;
|
|
1723
1725
|
}
|
|
@@ -1766,7 +1768,9 @@ class TextMeasure {
|
|
|
1766
1768
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
1767
1769
|
this._numberCharSize = {
|
|
1768
1770
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
1769
|
-
height: numberBounds.height
|
|
1771
|
+
height: numberBounds.height,
|
|
1772
|
+
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
1773
|
+
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
1770
1774
|
};
|
|
1771
1775
|
}
|
|
1772
1776
|
return this._numberCharSize;
|
|
@@ -1779,7 +1783,9 @@ class TextMeasure {
|
|
|
1779
1783
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
1780
1784
|
this._letterCharSize = {
|
|
1781
1785
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
1782
|
-
height: alphabetBounds.height
|
|
1786
|
+
height: alphabetBounds.height,
|
|
1787
|
+
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
1788
|
+
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
1783
1789
|
};
|
|
1784
1790
|
}
|
|
1785
1791
|
return this._letterCharSize;
|
|
@@ -14598,12 +14604,20 @@ class CanvasTextLayout {
|
|
|
14598
14604
|
constructor(fontFamily, options, textMeasure) {
|
|
14599
14605
|
this.fontFamily = fontFamily, this.textOptions = options, this.textMeasure = textMeasure;
|
|
14600
14606
|
}
|
|
14601
|
-
LayoutBBox(bbox, textAlign, textBaseline) {
|
|
14607
|
+
LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
|
|
14602
14608
|
if ("left" === textAlign || "start" === textAlign) bbox.xOffset = 0;else if ("center" === textAlign) bbox.xOffset = bbox.width / -2;else {
|
|
14603
14609
|
if ("right" !== textAlign && "end" !== textAlign) throw new Error("非法的textAlign");
|
|
14604
14610
|
bbox.xOffset = -bbox.width;
|
|
14605
14611
|
}
|
|
14606
|
-
|
|
14612
|
+
if ("top" === textBaseline) bbox.yOffset = 0;else if ("middle" === textBaseline) bbox.yOffset = bbox.height / -2;else if ("alphabetic" === textBaseline) {
|
|
14613
|
+
let percent = .79;
|
|
14614
|
+
if (1 === linesLayout.length) {
|
|
14615
|
+
const lineInfo = linesLayout[0];
|
|
14616
|
+
percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
|
|
14617
|
+
}
|
|
14618
|
+
bbox.yOffset = bbox.height * -percent;
|
|
14619
|
+
} else bbox.yOffset = -bbox.height;
|
|
14620
|
+
return bbox;
|
|
14607
14621
|
}
|
|
14608
14622
|
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
14609
14623
|
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
@@ -14652,7 +14666,7 @@ class CanvasTextLayout {
|
|
|
14652
14666
|
width: bboxWH[0],
|
|
14653
14667
|
height: bboxWH[1]
|
|
14654
14668
|
};
|
|
14655
|
-
return this.LayoutBBox(bbox, textAlign, textBaseline), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14669
|
+
return this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14656
14670
|
}
|
|
14657
14671
|
layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
|
|
14658
14672
|
const origin = [0, 0],
|
|
@@ -14671,7 +14685,9 @@ class CanvasTextLayout {
|
|
|
14671
14685
|
};
|
|
14672
14686
|
}
|
|
14673
14687
|
lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
|
|
14674
|
-
|
|
14688
|
+
"left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1];
|
|
14689
|
+
const actualHeightWithBuf = line.ascent + line.descent + 0;
|
|
14690
|
+
return actualHeightWithBuf < lineHeight - 0 && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2)), origin[1] += lineHeight, line;
|
|
14675
14691
|
}
|
|
14676
14692
|
}
|
|
14677
14693
|
|
|
@@ -14959,7 +14975,7 @@ class Text extends Graphic {
|
|
|
14959
14975
|
width: bboxWH[0],
|
|
14960
14976
|
height: bboxWH[1]
|
|
14961
14977
|
};
|
|
14962
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
14978
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
|
|
14963
14979
|
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14964
14980
|
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14965
14981
|
}
|
|
@@ -28612,7 +28628,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28612
28628
|
|
|
28613
28629
|
const roughModule = _roughModule;
|
|
28614
28630
|
|
|
28615
|
-
const version = "0.21.0-alpha.
|
|
28631
|
+
const version = "0.21.0-alpha.8";
|
|
28616
28632
|
preLoadAllModule();
|
|
28617
28633
|
if (isBrowserEnv()) {
|
|
28618
28634
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -1709,7 +1709,9 @@
|
|
|
1709
1709
|
} = this.textSpec;
|
|
1710
1710
|
return {
|
|
1711
1711
|
width: metrics.width,
|
|
1712
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
1712
|
+
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize,
|
|
1713
|
+
fontBoundingBoxAscent: metrics.fontBoundingBoxAscent,
|
|
1714
|
+
fontBoundingBoxDescent: metrics.fontBoundingBoxDescent
|
|
1713
1715
|
};
|
|
1714
1716
|
}
|
|
1715
1717
|
quickMeasure(text) {
|
|
@@ -1723,7 +1725,7 @@
|
|
|
1723
1725
|
for (let i = 0; i < text.length; i++) {
|
|
1724
1726
|
const char = text[i];
|
|
1725
1727
|
let size = this._measureSpecialChar(char);
|
|
1726
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
1728
|
+
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height), !isNil$1(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent), !isNil$1(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
|
|
1727
1729
|
}
|
|
1728
1730
|
return totalSize;
|
|
1729
1731
|
}
|
|
@@ -1772,7 +1774,9 @@
|
|
|
1772
1774
|
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
1773
1775
|
this._numberCharSize = {
|
|
1774
1776
|
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
1775
|
-
height: numberBounds.height
|
|
1777
|
+
height: numberBounds.height,
|
|
1778
|
+
fontBoundingBoxAscent: numberBounds.fontBoundingBoxAscent,
|
|
1779
|
+
fontBoundingBoxDescent: numberBounds.fontBoundingBoxDescent
|
|
1776
1780
|
};
|
|
1777
1781
|
}
|
|
1778
1782
|
return this._numberCharSize;
|
|
@@ -1785,7 +1789,9 @@
|
|
|
1785
1789
|
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
1786
1790
|
this._letterCharSize = {
|
|
1787
1791
|
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
1788
|
-
height: alphabetBounds.height
|
|
1792
|
+
height: alphabetBounds.height,
|
|
1793
|
+
fontBoundingBoxAscent: alphabetBounds.fontBoundingBoxAscent,
|
|
1794
|
+
fontBoundingBoxDescent: alphabetBounds.fontBoundingBoxDescent
|
|
1789
1795
|
};
|
|
1790
1796
|
}
|
|
1791
1797
|
return this._letterCharSize;
|
|
@@ -14604,12 +14610,20 @@
|
|
|
14604
14610
|
constructor(fontFamily, options, textMeasure) {
|
|
14605
14611
|
this.fontFamily = fontFamily, this.textOptions = options, this.textMeasure = textMeasure;
|
|
14606
14612
|
}
|
|
14607
|
-
LayoutBBox(bbox, textAlign, textBaseline) {
|
|
14613
|
+
LayoutBBox(bbox, textAlign, textBaseline, linesLayout) {
|
|
14608
14614
|
if ("left" === textAlign || "start" === textAlign) bbox.xOffset = 0;else if ("center" === textAlign) bbox.xOffset = bbox.width / -2;else {
|
|
14609
14615
|
if ("right" !== textAlign && "end" !== textAlign) throw new Error("非法的textAlign");
|
|
14610
14616
|
bbox.xOffset = -bbox.width;
|
|
14611
14617
|
}
|
|
14612
|
-
|
|
14618
|
+
if ("top" === textBaseline) bbox.yOffset = 0;else if ("middle" === textBaseline) bbox.yOffset = bbox.height / -2;else if ("alphabetic" === textBaseline) {
|
|
14619
|
+
let percent = .79;
|
|
14620
|
+
if (1 === linesLayout.length) {
|
|
14621
|
+
const lineInfo = linesLayout[0];
|
|
14622
|
+
percent = lineInfo.ascent / (lineInfo.ascent + lineInfo.descent);
|
|
14623
|
+
}
|
|
14624
|
+
bbox.yOffset = bbox.height * -percent;
|
|
14625
|
+
} else bbox.yOffset = -bbox.height;
|
|
14626
|
+
return bbox;
|
|
14613
14627
|
}
|
|
14614
14628
|
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
14615
14629
|
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
@@ -14658,7 +14672,7 @@
|
|
|
14658
14672
|
width: bboxWH[0],
|
|
14659
14673
|
height: bboxWH[1]
|
|
14660
14674
|
};
|
|
14661
|
-
return this.LayoutBBox(bbox, textAlign, textBaseline), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14675
|
+
return this.LayoutBBox(bbox, textAlign, textBaseline, linesLayout), this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14662
14676
|
}
|
|
14663
14677
|
layoutWithBBox(bbox, lines, textAlign, textBaseline, lineHeight) {
|
|
14664
14678
|
const origin = [0, 0],
|
|
@@ -14677,7 +14691,9 @@
|
|
|
14677
14691
|
};
|
|
14678
14692
|
}
|
|
14679
14693
|
lineOffset(bbox, line, textAlign, textBaseline, lineHeight, origin) {
|
|
14680
|
-
|
|
14694
|
+
"left" === textAlign || "start" === textAlign ? line.leftOffset = 0 : "center" === textAlign ? line.leftOffset = (bbox.width - line.width) / 2 : "right" !== textAlign && "end" !== textAlign || (line.leftOffset = bbox.width - line.width), line.topOffset = lineHeight / 2 + (line.ascent - line.descent) / 2 + origin[1];
|
|
14695
|
+
const actualHeightWithBuf = line.ascent + line.descent + 0;
|
|
14696
|
+
return actualHeightWithBuf < lineHeight - 0 && ("bottom" === textBaseline ? line.topOffset += (lineHeight - actualHeightWithBuf) / 2 : "top" === textBaseline && (line.topOffset -= (lineHeight - actualHeightWithBuf) / 2)), origin[1] += lineHeight, line;
|
|
14681
14697
|
}
|
|
14682
14698
|
}
|
|
14683
14699
|
|
|
@@ -14965,7 +14981,7 @@
|
|
|
14965
14981
|
width: bboxWH[0],
|
|
14966
14982
|
height: bboxWH[1]
|
|
14967
14983
|
};
|
|
14968
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
14984
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
|
|
14969
14985
|
const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
14970
14986
|
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
14971
14987
|
}
|
|
@@ -28618,7 +28634,7 @@
|
|
|
28618
28634
|
|
|
28619
28635
|
const roughModule = _roughModule;
|
|
28620
28636
|
|
|
28621
|
-
const version = "0.21.0-alpha.
|
|
28637
|
+
const version = "0.21.0-alpha.8";
|
|
28622
28638
|
preLoadAllModule();
|
|
28623
28639
|
if (isBrowserEnv()) {
|
|
28624
28640
|
loadBrowserEnv(container);
|