mxcad 1.0.399 → 1.0.400
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/dist/mxcad.d.ts +3 -1
- package/dist/mxcad.es.js +85 -36
- package/dist/mxcad.umd.js +3 -3
- package/dist/wasm/2d/mxdrawassembly_min.js +2571 -2569
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +2594 -2592
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/dist/wasm/2d-x64/mxdrawassembly_min.js +602 -601
- package/dist/wasm/2d-x64/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-x64-st/mxdrawassembly_min.js +539 -538
- package/dist/wasm/2d-x64-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -13328,7 +13328,7 @@ declare class PubSub<Events extends PubSubEvent = PubSubEvent> {
|
|
|
13328
13328
|
*/
|
|
13329
13329
|
off<Key extends keyof Events>(event: Key, callback?: Events[keyof Events]): void;
|
|
13330
13330
|
}
|
|
13331
|
-
declare function getActualRenderStartPosition(this: MxCADMTextImp, contentHeight?: number, contentWidth?: number): McGePoint3d;
|
|
13331
|
+
declare function getActualRenderStartPosition(this: MxCADMTextImp, contentHeight?: number, contentWidth?: number, useBBoxX?: boolean): McGePoint3d;
|
|
13332
13332
|
declare function getLinePosition(this: MxCADMTextImp, paragraphIndex: number, lineIndex: number): {
|
|
13333
13333
|
start: McGePoint3d;
|
|
13334
13334
|
end: McGePoint3d;
|
|
@@ -13348,6 +13348,8 @@ declare class MxCADMTextImp extends PubSub<{
|
|
|
13348
13348
|
textAlignment: McDb.AttachmentPoint;
|
|
13349
13349
|
actualHeight: number;
|
|
13350
13350
|
actualWidth: number;
|
|
13351
|
+
/** 第一个字符串计算包围盒的最左侧x(worldDraw 时计算,供 getActualRenderStartPosition(useBBoxX=true) 使用) */
|
|
13352
|
+
firstStringBoxMinX: number | null;
|
|
13351
13353
|
mat: McGeMatrix3d;
|
|
13352
13354
|
angle: number;
|
|
13353
13355
|
lineHeightRatio: number;
|
package/dist/mxcad.es.js
CHANGED
|
@@ -14596,7 +14596,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
|
|
|
14596
14596
|
return MxG2312Obj.decodeFromGb2312Imp(hexstr);
|
|
14597
14597
|
};
|
|
14598
14598
|
|
|
14599
|
-
const version$1 = "1.0.
|
|
14599
|
+
const version$1 = "1.0.399";
|
|
14600
14600
|
|
|
14601
14601
|
var isSharedArrayBuffer = "SharedArrayBuffer" in window;
|
|
14602
14602
|
var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
|
|
@@ -14670,27 +14670,27 @@ var loadWams = /*#__PURE__*/function () {
|
|
|
14670
14670
|
};
|
|
14671
14671
|
}();
|
|
14672
14672
|
|
|
14673
|
-
function _arrayLikeToArray$
|
|
14673
|
+
function _arrayLikeToArray$c(arr, len) {
|
|
14674
14674
|
if (len == null || len > arr.length) len = arr.length;
|
|
14675
14675
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
14676
14676
|
return arr2;
|
|
14677
14677
|
}
|
|
14678
14678
|
|
|
14679
14679
|
function _arrayWithoutHoles(arr) {
|
|
14680
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
14680
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$c(arr);
|
|
14681
14681
|
}
|
|
14682
14682
|
|
|
14683
14683
|
function _iterableToArray(iter) {
|
|
14684
14684
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14685
14685
|
}
|
|
14686
14686
|
|
|
14687
|
-
function _unsupportedIterableToArray$
|
|
14687
|
+
function _unsupportedIterableToArray$c(o, minLen) {
|
|
14688
14688
|
if (!o) return;
|
|
14689
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
14689
|
+
if (typeof o === "string") return _arrayLikeToArray$c(o, minLen);
|
|
14690
14690
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
14691
14691
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
14692
14692
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
14693
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
14693
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen);
|
|
14694
14694
|
}
|
|
14695
14695
|
|
|
14696
14696
|
function _nonIterableSpread() {
|
|
@@ -14698,7 +14698,7 @@ function _nonIterableSpread() {
|
|
|
14698
14698
|
}
|
|
14699
14699
|
|
|
14700
14700
|
function _toConsumableArray(arr) {
|
|
14701
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$
|
|
14701
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$c(arr) || _nonIterableSpread();
|
|
14702
14702
|
}
|
|
14703
14703
|
|
|
14704
14704
|
function _setPrototypeOf$1(o, p) {
|
|
@@ -22111,9 +22111,9 @@ var McAppFunctonImp = /*#__PURE__*/function () {
|
|
|
22111
22111
|
}();
|
|
22112
22112
|
var McAppFuncton = new McAppFunctonImp();
|
|
22113
22113
|
|
|
22114
|
-
function _createForOfIteratorHelper$
|
|
22115
|
-
function _unsupportedIterableToArray$
|
|
22116
|
-
function _arrayLikeToArray$
|
|
22114
|
+
function _createForOfIteratorHelper$b(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$b(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
22115
|
+
function _unsupportedIterableToArray$b(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$b(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$b(r, a) : void 0; } }
|
|
22116
|
+
function _arrayLikeToArray$b(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22117
22117
|
var McGlobalVar = /*#__PURE__*/function () {
|
|
22118
22118
|
function McGlobalVar() {
|
|
22119
22119
|
_classCallCheck$1(this, McGlobalVar);
|
|
@@ -22202,7 +22202,7 @@ var McGlobalVar = /*#__PURE__*/function () {
|
|
|
22202
22202
|
key: "loadFromLocalStorage",
|
|
22203
22203
|
value: function loadFromLocalStorage() {
|
|
22204
22204
|
try {
|
|
22205
|
-
var _iterator = _createForOfIteratorHelper$
|
|
22205
|
+
var _iterator = _createForOfIteratorHelper$b(this.stringVars.keys()),
|
|
22206
22206
|
_step;
|
|
22207
22207
|
try {
|
|
22208
22208
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -22217,7 +22217,7 @@ var McGlobalVar = /*#__PURE__*/function () {
|
|
|
22217
22217
|
} finally {
|
|
22218
22218
|
_iterator.f();
|
|
22219
22219
|
}
|
|
22220
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
22220
|
+
var _iterator2 = _createForOfIteratorHelper$b(this.numberVars.keys()),
|
|
22221
22221
|
_step2;
|
|
22222
22222
|
try {
|
|
22223
22223
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -22235,7 +22235,7 @@ var McGlobalVar = /*#__PURE__*/function () {
|
|
|
22235
22235
|
} finally {
|
|
22236
22236
|
_iterator2.f();
|
|
22237
22237
|
}
|
|
22238
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
22238
|
+
var _iterator3 = _createForOfIteratorHelper$b(this.pointVars.keys()),
|
|
22239
22239
|
_step3;
|
|
22240
22240
|
try {
|
|
22241
22241
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -25770,9 +25770,9 @@ function getFragmentWidth(sequence, fragment) {
|
|
|
25770
25770
|
return width;
|
|
25771
25771
|
}
|
|
25772
25772
|
|
|
25773
|
-
function _createForOfIteratorHelper$
|
|
25774
|
-
function _unsupportedIterableToArray$
|
|
25775
|
-
function _arrayLikeToArray$
|
|
25773
|
+
function _createForOfIteratorHelper$a(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$a(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
25774
|
+
function _unsupportedIterableToArray$a(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$a(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$a(r, a) : void 0; } }
|
|
25775
|
+
function _arrayLikeToArray$a(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
25776
25776
|
function calculateLineBreaks(ent, textNodes, paragraphIndex, options) {
|
|
25777
25777
|
var maxWidth = options.maxWidth,
|
|
25778
25778
|
baseHeight = options.baseHeight,
|
|
@@ -25838,7 +25838,7 @@ function calculateLineBreaks(ent, textNodes, paragraphIndex, options) {
|
|
|
25838
25838
|
}
|
|
25839
25839
|
}
|
|
25840
25840
|
};
|
|
25841
|
-
var _iterator = _createForOfIteratorHelper$
|
|
25841
|
+
var _iterator = _createForOfIteratorHelper$a(sequences),
|
|
25842
25842
|
_step;
|
|
25843
25843
|
try {
|
|
25844
25844
|
var _loop = function _loop() {
|
|
@@ -25921,7 +25921,7 @@ function _nonIterableRest$1() {
|
|
|
25921
25921
|
}
|
|
25922
25922
|
|
|
25923
25923
|
function _slicedToArray$1(arr, i) {
|
|
25924
|
-
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$
|
|
25924
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$c(arr, i) || _nonIterableRest$1();
|
|
25925
25925
|
}
|
|
25926
25926
|
|
|
25927
25927
|
var setColor = function setColor(node, mcText) {
|
|
@@ -26150,9 +26150,9 @@ var getTextNodeBoxInfo = function getTextNodeBoxInfo(node, props) {
|
|
|
26150
26150
|
return getBoxInfo(mcText);
|
|
26151
26151
|
};
|
|
26152
26152
|
|
|
26153
|
-
function _createForOfIteratorHelper$
|
|
26154
|
-
function _unsupportedIterableToArray$
|
|
26155
|
-
function _arrayLikeToArray$
|
|
26153
|
+
function _createForOfIteratorHelper$9(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$9(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
26154
|
+
function _unsupportedIterableToArray$9(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$9(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$9(r, a) : void 0; } }
|
|
26155
|
+
function _arrayLikeToArray$9(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26156
26156
|
function unicodeToCadSpecialChar(text) {
|
|
26157
26157
|
var result = text;
|
|
26158
26158
|
MxCADMText.elementTextManager.forEachSpecialCharacter(function (cadChar, unicodeChar) {
|
|
@@ -26268,7 +26268,7 @@ function processText(node) {
|
|
|
26268
26268
|
if (nodeFormat.font !== void 0 || nodeFormat.bold === true || nodeFormat.italic === true) {
|
|
26269
26269
|
result += nodeFormatHandlers.font(node);
|
|
26270
26270
|
}
|
|
26271
|
-
var _iterator = _createForOfIteratorHelper$
|
|
26271
|
+
var _iterator = _createForOfIteratorHelper$9(autoFormatKeys),
|
|
26272
26272
|
_step;
|
|
26273
26273
|
try {
|
|
26274
26274
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -26336,7 +26336,7 @@ function processElement(element) {
|
|
|
26336
26336
|
if (element.lineHeightRatio !== void 0) {
|
|
26337
26337
|
result += "\\".concat(CADTextCommandType.LineSpacing).concat(element.lineHeightRatio.toFixed(2), ";");
|
|
26338
26338
|
}
|
|
26339
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
26339
|
+
var _iterator2 = _createForOfIteratorHelper$9(element.children),
|
|
26340
26340
|
_step2;
|
|
26341
26341
|
try {
|
|
26342
26342
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -26352,7 +26352,7 @@ function processElement(element) {
|
|
|
26352
26352
|
}
|
|
26353
26353
|
function slateToCADText(nodes) {
|
|
26354
26354
|
var paragraphs = [];
|
|
26355
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
26355
|
+
var _iterator3 = _createForOfIteratorHelper$9(nodes),
|
|
26356
26356
|
_step3;
|
|
26357
26357
|
try {
|
|
26358
26358
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -26604,9 +26604,9 @@ function calculateParagraph(ent, node, baseHeight, index) {
|
|
|
26604
26604
|
};
|
|
26605
26605
|
}
|
|
26606
26606
|
|
|
26607
|
-
function _createForOfIteratorHelper$
|
|
26608
|
-
function _unsupportedIterableToArray$
|
|
26609
|
-
function _arrayLikeToArray$
|
|
26607
|
+
function _createForOfIteratorHelper$8(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$8(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
26608
|
+
function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$8(r, a) : void 0; } }
|
|
26609
|
+
function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26610
26610
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26611
26611
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26612
26612
|
var drawLine$1 = function drawLine(draw, start, end, transformsMatrix) {
|
|
@@ -26734,7 +26734,7 @@ var renderParagraph = function renderParagraph(ent, draw, props) {
|
|
|
26734
26734
|
});
|
|
26735
26735
|
if (!isEmpty) {
|
|
26736
26736
|
var result = "";
|
|
26737
|
-
var _iterator = _createForOfIteratorHelper$
|
|
26737
|
+
var _iterator = _createForOfIteratorHelper$8(_nodes),
|
|
26738
26738
|
_step;
|
|
26739
26739
|
try {
|
|
26740
26740
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -27251,6 +27251,7 @@ var PubSub = /*#__PURE__*/function () {
|
|
|
27251
27251
|
function getActualRenderStartPosition() {
|
|
27252
27252
|
var contentHeight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.actualHeight;
|
|
27253
27253
|
var contentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.actualWidth;
|
|
27254
|
+
var useBBoxX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
27254
27255
|
var topLeft = this.getTopLeftPt();
|
|
27255
27256
|
var centerY = topLeft.y - this.maxHeight / 2;
|
|
27256
27257
|
var centerX = topLeft.x + this.maxWidth / 2;
|
|
@@ -27320,6 +27321,9 @@ function getActualRenderStartPosition() {
|
|
|
27320
27321
|
}
|
|
27321
27322
|
}
|
|
27322
27323
|
}
|
|
27324
|
+
if (useBBoxX && this.firstStringBoxMinX != null) {
|
|
27325
|
+
startX = this.firstStringBoxMinX;
|
|
27326
|
+
}
|
|
27323
27327
|
return new McGePoint3d(startX, startY, topLeft.z);
|
|
27324
27328
|
}
|
|
27325
27329
|
|
|
@@ -27453,6 +27457,7 @@ var MxCADMTextImp = /*#__PURE__*/function (_PubSub) {
|
|
|
27453
27457
|
_defineProperty(_assertThisInitialized$1(_this), "textAlignment", McDb.AttachmentPoint.kTopLeft);
|
|
27454
27458
|
_defineProperty(_assertThisInitialized$1(_this), "actualHeight", 0);
|
|
27455
27459
|
_defineProperty(_assertThisInitialized$1(_this), "actualWidth", 0);
|
|
27460
|
+
_defineProperty(_assertThisInitialized$1(_this), "firstStringBoxMinX", null);
|
|
27456
27461
|
_defineProperty(_assertThisInitialized$1(_this), "mat", new McGeMatrix3d());
|
|
27457
27462
|
_defineProperty(_assertThisInitialized$1(_this), "angle", 0);
|
|
27458
27463
|
_defineProperty(_assertThisInitialized$1(_this), "lineHeightRatio", 1.66666);
|
|
@@ -27977,7 +27982,9 @@ var MultilineTextConverter = /*#__PURE__*/function () {
|
|
|
27977
27982
|
key: "fromMText",
|
|
27978
27983
|
value: function fromMText(mtext) {
|
|
27979
27984
|
var customEntity = new MxCADMText();
|
|
27980
|
-
|
|
27985
|
+
mtext.reCompute(true);
|
|
27986
|
+
var _getBoxInfo = getBoxInfo(mtext),
|
|
27987
|
+
box = _getBoxInfo.box;
|
|
27981
27988
|
var position;
|
|
27982
27989
|
var location = mtext.location;
|
|
27983
27990
|
var width = mtext.width === 0 ? box.maxPt.x - box.minPt.x : mtext.width;
|
|
@@ -28205,7 +28212,7 @@ function convertCadPointToSlatePoint(point) {
|
|
|
28205
28212
|
var totalHeight = mTextImp.getTotalContentHeight();
|
|
28206
28213
|
var _calculateContentWidt = calculateContentWidth(this),
|
|
28207
28214
|
alignmentWidth = _calculateContentWidt.alignmentWidth;
|
|
28208
|
-
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth);
|
|
28215
|
+
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth, true);
|
|
28209
28216
|
for (var pIndex = 0; pIndex < mTextImp.__PARAGRAPH_INFOS__.length; pIndex++) {
|
|
28210
28217
|
var _paragraphInfo$lines, _paragraphInfo$lines2;
|
|
28211
28218
|
var paragraphInfo = mTextImp.getParagrapInfo(pIndex);
|
|
@@ -28657,9 +28664,9 @@ function convertCadPointToSlatePoint(point) {
|
|
|
28657
28664
|
return null;
|
|
28658
28665
|
}
|
|
28659
28666
|
|
|
28660
|
-
function _createForOfIteratorHelper$
|
|
28661
|
-
function _unsupportedIterableToArray$
|
|
28662
|
-
function _arrayLikeToArray$
|
|
28667
|
+
function _createForOfIteratorHelper$7(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$7(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
28668
|
+
function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0; } }
|
|
28669
|
+
function _arrayLikeToArray$7(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28663
28670
|
function convertSlatePointToCadPoint(point) {
|
|
28664
28671
|
var _paragraphInfo$lines,
|
|
28665
28672
|
_paragraphInfo$lines2,
|
|
@@ -28670,7 +28677,7 @@ function convertSlatePointToCadPoint(point) {
|
|
|
28670
28677
|
var totalHeight = mTextImp.getTotalContentHeight();
|
|
28671
28678
|
var _calculateContentWidt = calculateContentWidth(this),
|
|
28672
28679
|
alignmentWidth = _calculateContentWidt.alignmentWidth;
|
|
28673
|
-
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth);
|
|
28680
|
+
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth, true);
|
|
28674
28681
|
var paragraphIndex = path[0];
|
|
28675
28682
|
var paragraphInfo = mTextImp.__PARAGRAPH_INFOS__[paragraphIndex];
|
|
28676
28683
|
if (!paragraphInfo) return null;
|
|
@@ -28788,7 +28795,7 @@ function convertSlatePointToCadPoint(point) {
|
|
|
28788
28795
|
}
|
|
28789
28796
|
}
|
|
28790
28797
|
}
|
|
28791
|
-
var _iterator = _createForOfIteratorHelper$
|
|
28798
|
+
var _iterator = _createForOfIteratorHelper$7(line.nodes),
|
|
28792
28799
|
_step;
|
|
28793
28800
|
try {
|
|
28794
28801
|
var _loop = function _loop() {
|
|
@@ -28974,6 +28981,9 @@ var MxCADBaseCustomText = /*#__PURE__*/_createClass$1(function MxCADBaseCustomTe
|
|
|
28974
28981
|
_classCallCheck$1(this, MxCADBaseCustomText);
|
|
28975
28982
|
});
|
|
28976
28983
|
|
|
28984
|
+
function _createForOfIteratorHelper$6(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$6(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
28985
|
+
function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0; } }
|
|
28986
|
+
function _arrayLikeToArray$6(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28977
28987
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28978
28988
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28979
28989
|
function _createSuper$3(t) { var r = _isNativeReflectConstruct$4(); return function () { var e, o = _getPrototypeOf$1(t); if (r) { var s = _getPrototypeOf$1(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn$1(this, e); }; }
|
|
@@ -29176,6 +29186,45 @@ var MxCADMText = /*#__PURE__*/function (_McDbCustomEntity) {
|
|
|
29176
29186
|
});
|
|
29177
29187
|
imp.actualWidth = Math.max(imp.maxWidth, maxWidth);
|
|
29178
29188
|
imp.actualHeight = Math.max(imp.maxHeight, totalHeight);
|
|
29189
|
+
imp.firstStringBoxMinX = null;
|
|
29190
|
+
outer: for (var p = 0; p < imp.__PARAGRAPH_INFOS__.length; p++) {
|
|
29191
|
+
var info = imp.__PARAGRAPH_INFOS__[p];
|
|
29192
|
+
if (!(info !== null && info !== void 0 && info.lines)) continue;
|
|
29193
|
+
var _iterator = _createForOfIteratorHelper$6(info.lines),
|
|
29194
|
+
_step;
|
|
29195
|
+
try {
|
|
29196
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
29197
|
+
var line = _step.value;
|
|
29198
|
+
if (!(line !== null && line !== void 0 && line.nodes)) continue;
|
|
29199
|
+
var firstNode = line.nodes.find(function (n) {
|
|
29200
|
+
return isText(n.node) && !(n.node.type && MxCADMText.elementTextManager.hasText(n.node.type)) && n.endOffset > n.startOffset;
|
|
29201
|
+
});
|
|
29202
|
+
if (!firstNode || !isText(firstNode.node)) continue;
|
|
29203
|
+
try {
|
|
29204
|
+
var paragraphPosition = calculateParagraphPosition(this, startPoint, p);
|
|
29205
|
+
var lineStartX = calculateLineStartX(this, paragraphPosition, alignmentWidth, line.width, p);
|
|
29206
|
+
var text = firstNode.node.text.substring(firstNode.startOffset, firstNode.endOffset);
|
|
29207
|
+
var boxInfo = getTextNodeBoxInfo(_objectSpread$2(_objectSpread$2({}, firstNode.node), {}, {
|
|
29208
|
+
text: unicodeToCadSpecialChar(text)
|
|
29209
|
+
}), {
|
|
29210
|
+
position: new McGePoint3d(lineStartX, 0, 0),
|
|
29211
|
+
baseHeight: imp.textBaseHeight,
|
|
29212
|
+
style: this.textStyle,
|
|
29213
|
+
ent: this
|
|
29214
|
+
});
|
|
29215
|
+
if (boxInfo !== null && boxInfo !== void 0 && boxInfo.box) {
|
|
29216
|
+
imp.firstStringBoxMinX = boxInfo.box.minPt.x;
|
|
29217
|
+
console.log("[MxCADMText] firstStringBoxMinX:", imp.firstStringBoxMinX, "position.x:", imp.position.x, "delta:", imp.firstStringBoxMinX - imp.position.x);
|
|
29218
|
+
}
|
|
29219
|
+
} catch (e) {}
|
|
29220
|
+
break outer;
|
|
29221
|
+
}
|
|
29222
|
+
} catch (err) {
|
|
29223
|
+
_iterator.e(err);
|
|
29224
|
+
} finally {
|
|
29225
|
+
_iterator.f();
|
|
29226
|
+
}
|
|
29227
|
+
}
|
|
29179
29228
|
imp.emit("changed");
|
|
29180
29229
|
}
|
|
29181
29230
|
}, {
|
|
@@ -29209,7 +29258,7 @@ var MxCADMText = /*#__PURE__*/function (_McDbCustomEntity) {
|
|
|
29209
29258
|
var mTextImp = this.impMText;
|
|
29210
29259
|
var width = mTextImp.actualWidth;
|
|
29211
29260
|
var height = mTextImp.actualHeight - this.lineHeightRatio;
|
|
29212
|
-
var pt = mTextImp.getActualRenderStartPosition();
|
|
29261
|
+
var pt = mTextImp.getActualRenderStartPosition(void 0, void 0, true);
|
|
29213
29262
|
return {
|
|
29214
29263
|
minPt: pt,
|
|
29215
29264
|
maxPt: new McGePoint3d(pt.x + width, pt.y - height),
|