mxcad 1.0.398 → 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 +12 -4
- package/dist/mxcad.es.js +95 -36
- package/dist/mxcad.umd.js +3 -3
- package/dist/wasm/2d/mxdrawassembly_min.js +2571 -2568
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +2594 -2591
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/dist/wasm/2d-x64/mxdrawassembly_min.js +1468 -1466
- package/dist/wasm/2d-x64/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-x64-st/mxdrawassembly_min.js +1416 -1414
- package/dist/wasm/2d-x64-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -11463,9 +11463,15 @@ export declare class McObject {
|
|
|
11463
11463
|
*/
|
|
11464
11464
|
undoMark(): void;
|
|
11465
11465
|
/**
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11466
|
+
*当前是否存在回退数据。
|
|
11467
|
+
*/
|
|
11468
|
+
isUndo(): boolean;
|
|
11469
|
+
/**
|
|
11470
|
+
*当前是否存在重做数据。
|
|
11471
|
+
*/
|
|
11472
|
+
isRedo(): boolean;
|
|
11473
|
+
/**
|
|
11474
|
+
*回退标记索引加1.,用于内部使用。
|
|
11469
11475
|
*/
|
|
11470
11476
|
undoIndexIncrease(): void;
|
|
11471
11477
|
}
|
|
@@ -13322,7 +13328,7 @@ declare class PubSub<Events extends PubSubEvent = PubSubEvent> {
|
|
|
13322
13328
|
*/
|
|
13323
13329
|
off<Key extends keyof Events>(event: Key, callback?: Events[keyof Events]): void;
|
|
13324
13330
|
}
|
|
13325
|
-
declare function getActualRenderStartPosition(this: MxCADMTextImp, contentHeight?: number, contentWidth?: number): McGePoint3d;
|
|
13331
|
+
declare function getActualRenderStartPosition(this: MxCADMTextImp, contentHeight?: number, contentWidth?: number, useBBoxX?: boolean): McGePoint3d;
|
|
13326
13332
|
declare function getLinePosition(this: MxCADMTextImp, paragraphIndex: number, lineIndex: number): {
|
|
13327
13333
|
start: McGePoint3d;
|
|
13328
13334
|
end: McGePoint3d;
|
|
@@ -13342,6 +13348,8 @@ declare class MxCADMTextImp extends PubSub<{
|
|
|
13342
13348
|
textAlignment: McDb.AttachmentPoint;
|
|
13343
13349
|
actualHeight: number;
|
|
13344
13350
|
actualWidth: number;
|
|
13351
|
+
/** 第一个字符串计算包围盒的最左侧x(worldDraw 时计算,供 getActualRenderStartPosition(useBBoxX=true) 使用) */
|
|
13352
|
+
firstStringBoxMinX: number | null;
|
|
13345
13353
|
mat: McGeMatrix3d;
|
|
13346
13354
|
angle: number;
|
|
13347
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;) {
|
|
@@ -23612,6 +23612,16 @@ var McObject = /*#__PURE__*/function () {
|
|
|
23612
23612
|
value: function undoMark() {
|
|
23613
23613
|
this.imp.undoMark();
|
|
23614
23614
|
}
|
|
23615
|
+
}, {
|
|
23616
|
+
key: "isUndo",
|
|
23617
|
+
value: function isUndo() {
|
|
23618
|
+
return this.imp.isUndo();
|
|
23619
|
+
}
|
|
23620
|
+
}, {
|
|
23621
|
+
key: "isRedo",
|
|
23622
|
+
value: function isRedo() {
|
|
23623
|
+
return this.imp.isRedo();
|
|
23624
|
+
}
|
|
23615
23625
|
}, {
|
|
23616
23626
|
key: "undoIndexIncrease",
|
|
23617
23627
|
value: function undoIndexIncrease() {
|
|
@@ -25760,9 +25770,9 @@ function getFragmentWidth(sequence, fragment) {
|
|
|
25760
25770
|
return width;
|
|
25761
25771
|
}
|
|
25762
25772
|
|
|
25763
|
-
function _createForOfIteratorHelper$
|
|
25764
|
-
function _unsupportedIterableToArray$
|
|
25765
|
-
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; }
|
|
25766
25776
|
function calculateLineBreaks(ent, textNodes, paragraphIndex, options) {
|
|
25767
25777
|
var maxWidth = options.maxWidth,
|
|
25768
25778
|
baseHeight = options.baseHeight,
|
|
@@ -25828,7 +25838,7 @@ function calculateLineBreaks(ent, textNodes, paragraphIndex, options) {
|
|
|
25828
25838
|
}
|
|
25829
25839
|
}
|
|
25830
25840
|
};
|
|
25831
|
-
var _iterator = _createForOfIteratorHelper$
|
|
25841
|
+
var _iterator = _createForOfIteratorHelper$a(sequences),
|
|
25832
25842
|
_step;
|
|
25833
25843
|
try {
|
|
25834
25844
|
var _loop = function _loop() {
|
|
@@ -25911,7 +25921,7 @@ function _nonIterableRest$1() {
|
|
|
25911
25921
|
}
|
|
25912
25922
|
|
|
25913
25923
|
function _slicedToArray$1(arr, i) {
|
|
25914
|
-
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$
|
|
25924
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$c(arr, i) || _nonIterableRest$1();
|
|
25915
25925
|
}
|
|
25916
25926
|
|
|
25917
25927
|
var setColor = function setColor(node, mcText) {
|
|
@@ -26140,9 +26150,9 @@ var getTextNodeBoxInfo = function getTextNodeBoxInfo(node, props) {
|
|
|
26140
26150
|
return getBoxInfo(mcText);
|
|
26141
26151
|
};
|
|
26142
26152
|
|
|
26143
|
-
function _createForOfIteratorHelper$
|
|
26144
|
-
function _unsupportedIterableToArray$
|
|
26145
|
-
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; }
|
|
26146
26156
|
function unicodeToCadSpecialChar(text) {
|
|
26147
26157
|
var result = text;
|
|
26148
26158
|
MxCADMText.elementTextManager.forEachSpecialCharacter(function (cadChar, unicodeChar) {
|
|
@@ -26258,7 +26268,7 @@ function processText(node) {
|
|
|
26258
26268
|
if (nodeFormat.font !== void 0 || nodeFormat.bold === true || nodeFormat.italic === true) {
|
|
26259
26269
|
result += nodeFormatHandlers.font(node);
|
|
26260
26270
|
}
|
|
26261
|
-
var _iterator = _createForOfIteratorHelper$
|
|
26271
|
+
var _iterator = _createForOfIteratorHelper$9(autoFormatKeys),
|
|
26262
26272
|
_step;
|
|
26263
26273
|
try {
|
|
26264
26274
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -26326,7 +26336,7 @@ function processElement(element) {
|
|
|
26326
26336
|
if (element.lineHeightRatio !== void 0) {
|
|
26327
26337
|
result += "\\".concat(CADTextCommandType.LineSpacing).concat(element.lineHeightRatio.toFixed(2), ";");
|
|
26328
26338
|
}
|
|
26329
|
-
var _iterator2 = _createForOfIteratorHelper$
|
|
26339
|
+
var _iterator2 = _createForOfIteratorHelper$9(element.children),
|
|
26330
26340
|
_step2;
|
|
26331
26341
|
try {
|
|
26332
26342
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -26342,7 +26352,7 @@ function processElement(element) {
|
|
|
26342
26352
|
}
|
|
26343
26353
|
function slateToCADText(nodes) {
|
|
26344
26354
|
var paragraphs = [];
|
|
26345
|
-
var _iterator3 = _createForOfIteratorHelper$
|
|
26355
|
+
var _iterator3 = _createForOfIteratorHelper$9(nodes),
|
|
26346
26356
|
_step3;
|
|
26347
26357
|
try {
|
|
26348
26358
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -26594,9 +26604,9 @@ function calculateParagraph(ent, node, baseHeight, index) {
|
|
|
26594
26604
|
};
|
|
26595
26605
|
}
|
|
26596
26606
|
|
|
26597
|
-
function _createForOfIteratorHelper$
|
|
26598
|
-
function _unsupportedIterableToArray$
|
|
26599
|
-
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; }
|
|
26600
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; }
|
|
26601
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; }
|
|
26602
26612
|
var drawLine$1 = function drawLine(draw, start, end, transformsMatrix) {
|
|
@@ -26724,7 +26734,7 @@ var renderParagraph = function renderParagraph(ent, draw, props) {
|
|
|
26724
26734
|
});
|
|
26725
26735
|
if (!isEmpty) {
|
|
26726
26736
|
var result = "";
|
|
26727
|
-
var _iterator = _createForOfIteratorHelper$
|
|
26737
|
+
var _iterator = _createForOfIteratorHelper$8(_nodes),
|
|
26728
26738
|
_step;
|
|
26729
26739
|
try {
|
|
26730
26740
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -27241,6 +27251,7 @@ var PubSub = /*#__PURE__*/function () {
|
|
|
27241
27251
|
function getActualRenderStartPosition() {
|
|
27242
27252
|
var contentHeight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.actualHeight;
|
|
27243
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;
|
|
27244
27255
|
var topLeft = this.getTopLeftPt();
|
|
27245
27256
|
var centerY = topLeft.y - this.maxHeight / 2;
|
|
27246
27257
|
var centerX = topLeft.x + this.maxWidth / 2;
|
|
@@ -27310,6 +27321,9 @@ function getActualRenderStartPosition() {
|
|
|
27310
27321
|
}
|
|
27311
27322
|
}
|
|
27312
27323
|
}
|
|
27324
|
+
if (useBBoxX && this.firstStringBoxMinX != null) {
|
|
27325
|
+
startX = this.firstStringBoxMinX;
|
|
27326
|
+
}
|
|
27313
27327
|
return new McGePoint3d(startX, startY, topLeft.z);
|
|
27314
27328
|
}
|
|
27315
27329
|
|
|
@@ -27443,6 +27457,7 @@ var MxCADMTextImp = /*#__PURE__*/function (_PubSub) {
|
|
|
27443
27457
|
_defineProperty(_assertThisInitialized$1(_this), "textAlignment", McDb.AttachmentPoint.kTopLeft);
|
|
27444
27458
|
_defineProperty(_assertThisInitialized$1(_this), "actualHeight", 0);
|
|
27445
27459
|
_defineProperty(_assertThisInitialized$1(_this), "actualWidth", 0);
|
|
27460
|
+
_defineProperty(_assertThisInitialized$1(_this), "firstStringBoxMinX", null);
|
|
27446
27461
|
_defineProperty(_assertThisInitialized$1(_this), "mat", new McGeMatrix3d());
|
|
27447
27462
|
_defineProperty(_assertThisInitialized$1(_this), "angle", 0);
|
|
27448
27463
|
_defineProperty(_assertThisInitialized$1(_this), "lineHeightRatio", 1.66666);
|
|
@@ -27967,7 +27982,9 @@ var MultilineTextConverter = /*#__PURE__*/function () {
|
|
|
27967
27982
|
key: "fromMText",
|
|
27968
27983
|
value: function fromMText(mtext) {
|
|
27969
27984
|
var customEntity = new MxCADMText();
|
|
27970
|
-
|
|
27985
|
+
mtext.reCompute(true);
|
|
27986
|
+
var _getBoxInfo = getBoxInfo(mtext),
|
|
27987
|
+
box = _getBoxInfo.box;
|
|
27971
27988
|
var position;
|
|
27972
27989
|
var location = mtext.location;
|
|
27973
27990
|
var width = mtext.width === 0 ? box.maxPt.x - box.minPt.x : mtext.width;
|
|
@@ -28195,7 +28212,7 @@ function convertCadPointToSlatePoint(point) {
|
|
|
28195
28212
|
var totalHeight = mTextImp.getTotalContentHeight();
|
|
28196
28213
|
var _calculateContentWidt = calculateContentWidth(this),
|
|
28197
28214
|
alignmentWidth = _calculateContentWidt.alignmentWidth;
|
|
28198
|
-
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth);
|
|
28215
|
+
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth, true);
|
|
28199
28216
|
for (var pIndex = 0; pIndex < mTextImp.__PARAGRAPH_INFOS__.length; pIndex++) {
|
|
28200
28217
|
var _paragraphInfo$lines, _paragraphInfo$lines2;
|
|
28201
28218
|
var paragraphInfo = mTextImp.getParagrapInfo(pIndex);
|
|
@@ -28647,9 +28664,9 @@ function convertCadPointToSlatePoint(point) {
|
|
|
28647
28664
|
return null;
|
|
28648
28665
|
}
|
|
28649
28666
|
|
|
28650
|
-
function _createForOfIteratorHelper$
|
|
28651
|
-
function _unsupportedIterableToArray$
|
|
28652
|
-
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; }
|
|
28653
28670
|
function convertSlatePointToCadPoint(point) {
|
|
28654
28671
|
var _paragraphInfo$lines,
|
|
28655
28672
|
_paragraphInfo$lines2,
|
|
@@ -28660,7 +28677,7 @@ function convertSlatePointToCadPoint(point) {
|
|
|
28660
28677
|
var totalHeight = mTextImp.getTotalContentHeight();
|
|
28661
28678
|
var _calculateContentWidt = calculateContentWidth(this),
|
|
28662
28679
|
alignmentWidth = _calculateContentWidt.alignmentWidth;
|
|
28663
|
-
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth);
|
|
28680
|
+
var startPoint = mTextImp.getActualRenderStartPosition(totalHeight, alignmentWidth, true);
|
|
28664
28681
|
var paragraphIndex = path[0];
|
|
28665
28682
|
var paragraphInfo = mTextImp.__PARAGRAPH_INFOS__[paragraphIndex];
|
|
28666
28683
|
if (!paragraphInfo) return null;
|
|
@@ -28778,7 +28795,7 @@ function convertSlatePointToCadPoint(point) {
|
|
|
28778
28795
|
}
|
|
28779
28796
|
}
|
|
28780
28797
|
}
|
|
28781
|
-
var _iterator = _createForOfIteratorHelper$
|
|
28798
|
+
var _iterator = _createForOfIteratorHelper$7(line.nodes),
|
|
28782
28799
|
_step;
|
|
28783
28800
|
try {
|
|
28784
28801
|
var _loop = function _loop() {
|
|
@@ -28964,6 +28981,9 @@ var MxCADBaseCustomText = /*#__PURE__*/_createClass$1(function MxCADBaseCustomTe
|
|
|
28964
28981
|
_classCallCheck$1(this, MxCADBaseCustomText);
|
|
28965
28982
|
});
|
|
28966
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; }
|
|
28967
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; }
|
|
28968
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; }
|
|
28969
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); }; }
|
|
@@ -29166,6 +29186,45 @@ var MxCADMText = /*#__PURE__*/function (_McDbCustomEntity) {
|
|
|
29166
29186
|
});
|
|
29167
29187
|
imp.actualWidth = Math.max(imp.maxWidth, maxWidth);
|
|
29168
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
|
+
}
|
|
29169
29228
|
imp.emit("changed");
|
|
29170
29229
|
}
|
|
29171
29230
|
}, {
|
|
@@ -29199,7 +29258,7 @@ var MxCADMText = /*#__PURE__*/function (_McDbCustomEntity) {
|
|
|
29199
29258
|
var mTextImp = this.impMText;
|
|
29200
29259
|
var width = mTextImp.actualWidth;
|
|
29201
29260
|
var height = mTextImp.actualHeight - this.lineHeightRatio;
|
|
29202
|
-
var pt = mTextImp.getActualRenderStartPosition();
|
|
29261
|
+
var pt = mTextImp.getActualRenderStartPosition(void 0, void 0, true);
|
|
29203
29262
|
return {
|
|
29204
29263
|
minPt: pt,
|
|
29205
29264
|
maxPt: new McGePoint3d(pt.x + width, pt.y - height),
|