mxcad 1.0.265 → 1.0.266

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 CHANGED
@@ -10100,6 +10100,14 @@ export declare class McDbDatabase extends McRxObject {
10100
10100
  */
10101
10101
  setCurrentlyTextStyle(sName: string): void;
10102
10102
  /**
10103
+ * 返回当前使用的线重.
10104
+ */
10105
+ getCurrentlyLineWeight(): McDb.LineWeight;
10106
+ /**
10107
+ * 设置当前使用的线重.
10108
+ */
10109
+ setCurrentlyLineWeight(lineWeight: McDb.LineWeight): void;
10110
+ /**
10103
10111
  * 返回当前文字样式id.
10104
10112
  */
10105
10113
  getCurrentlyTextStyleId(): McObjectId;
package/dist/mxcad.es.js CHANGED
@@ -14186,7 +14186,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
14186
14186
  return MxG2312Obj.decodeFromGb2312(hexstr);
14187
14187
  };
14188
14188
 
14189
- const version$1 = "1.0.265";
14189
+ const version$1 = "1.0.266";
14190
14190
 
14191
14191
  var isSharedArrayBuffer = ("SharedArrayBuffer" in window);
14192
14192
  var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
@@ -19494,6 +19494,16 @@ var McDbDatabase = /*#__PURE__*/function (_McRxObject) {
19494
19494
  var sHex = MxG2312Obj.encodeToGb2312(sName);
19495
19495
  this.imp.SetCurrentlyTextStyle(sHex);
19496
19496
  }
19497
+ }, {
19498
+ key: "getCurrentlyLineWeight",
19499
+ value: function getCurrentlyLineWeight() {
19500
+ return this.imp.GetCurrentlyLineWeight();
19501
+ }
19502
+ }, {
19503
+ key: "setCurrentlyLineWeight",
19504
+ value: function setCurrentlyLineWeight(lineWeight) {
19505
+ return this.imp.SetCurrentlyLineWeight(lineWeight);
19506
+ }
19497
19507
  }, {
19498
19508
  key: "getCurrentlyTextStyleId",
19499
19509
  value: function getCurrentlyTextStyleId() {
@@ -21169,17 +21179,17 @@ var McObject = /*#__PURE__*/function () {
21169
21179
  key: "getCurrentDatabaseDrawColor",
21170
21180
  value: function getCurrentDatabaseDrawColor() {
21171
21181
  var ary = this.getDatabase().getImp().GetCurrentlyDrawColor();
21172
- var lViewcolor = this.getMxDrawObject().getViewColor();
21182
+ var lWhiteViewColor = this.getMxDrawObject().isWhiteViewColor();
21173
21183
  var r = ary.at(0);
21174
21184
  var g = ary.at(1);
21175
21185
  var b = ary.at(2);
21176
- if (lViewcolor == 16777215) {
21186
+ if (lWhiteViewColor) {
21177
21187
  if (r == 255 && g == 255 && b == 255) {
21178
21188
  r = 0;
21179
21189
  g = 0;
21180
21190
  b = 0;
21181
21191
  }
21182
- } else if (lViewcolor == 0) {
21192
+ } else {
21183
21193
  if (r == 0 && g == 0 && b == 0) {
21184
21194
  r = 255;
21185
21195
  g = 255;
@@ -28774,7 +28784,10 @@ function _drawEllipticalArc() {
28774
28784
  getDist.setKeyWords("");
28775
28785
  getDist.setBasePt(center);
28776
28786
  getDist.setUserDraw(function (pt, pw) {
28777
- majorAxis = minorAxis = majorAxis.rotateBy(angleTo(center.x, center.y, pt.x, pt.y));
28787
+ var dx = Math.abs(pt.x - center.x);
28788
+ var dy = Math.abs(pt.y - center.y);
28789
+ var ratio = dx / (dx + dy);
28790
+ radiusRatio = ratio;
28778
28791
  var ellipseArc = createEllipse();
28779
28792
  pw.drawMcDbEntity(ellipseArc);
28780
28793
  });
@@ -28791,7 +28804,7 @@ function _drawEllipticalArc() {
28791
28804
  });
28792
28805
  case 60:
28793
28806
  if (getDist.getDetailedResult() === 8) {
28794
- rotation = val2;
28807
+ radiusRatio = val2;
28795
28808
  }
28796
28809
  _context.next = 67;
28797
28810
  break;
@@ -28815,12 +28828,13 @@ function _drawEllipticalArc() {
28815
28828
  v: void 0
28816
28829
  });
28817
28830
  case 69:
28818
- offsetAngle = angleTo(axisEndPoint1.x, axisEndPoint1.y, center.x, center.y);
28831
+ offsetAngle = Math.atan2(majorAxis.y, majorAxis.x) - Math.PI / 2;
28819
28832
  getDist.setMessage(_ML_String("McDbEllipse_startAngle", "\u6307\u5B9A\u8D77\u70B9\u89D2\u5EA6"));
28820
28833
  getDist.setKeyWords("");
28821
28834
  getDist.setBasePt(center);
28822
28835
  getDist.setUserDraw(function (pt, pw) {
28823
- startAngle = angleTo(center.x, center.y, pt.x, pt.y) - offsetAngle;
28836
+ var angle = Math.atan2(pt.y - center.y, pt.x - center.x);
28837
+ startAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
28824
28838
  var ellipseArc = createEllipse();
28825
28839
  pw.drawMcDbEntity(ellipseArc);
28826
28840
  });
@@ -28844,7 +28858,11 @@ function _drawEllipticalArc() {
28844
28858
  getDist.setMessage(_ML_String("McDbEllipse_endAngle", "\u6307\u5B9A\u7AEF\u70B9\u89D2\u5EA6"));
28845
28859
  getDist.setKeyWords("[\u5939\u89D2(I)]");
28846
28860
  getDist.setUserDraw(function (pt, pw) {
28847
- endAngle = angleTo(center.x, center.y, pt.x, pt.y) - offsetAngle;
28861
+ var angle = Math.atan2(pt.y - center.y, pt.x - center.x);
28862
+ endAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
28863
+ if (endAngle < startAngle) {
28864
+ endAngle += Math.PI * 2;
28865
+ }
28848
28866
  var ellipseArc = createEllipse();
28849
28867
  pw.drawMcDbEntity(ellipseArc);
28850
28868
  });
@@ -28948,7 +28966,7 @@ function _drawMxDbEllipse() {
28948
28966
  return ellipse;
28949
28967
  };
28950
28968
  _loop2 = /*#__PURE__*/regenerator.mark(function _loop2() {
28951
- var isGetAngle, isGetCenter, isDrawCenterArc, point, endPoint, centerPoint, point1, getDist, xRadius, drawEllipse, length, yRadius, angle, val, val1, val2, ellipse2, ellipse;
28969
+ var isGetAngle, isGetCenter, isDrawCenterArc, point, endPoint, centerPoint, point1, getDist, xRadius, drawEllipse, length, yRadius, offsetAngle, val, val1, val2, ellipse2, ellipse;
28952
28970
  return regenerator.wrap(function _loop2$(_context3) {
28953
28971
  while (1) switch (_context3.prev = _context3.next) {
28954
28972
  case 0:
@@ -28989,7 +29007,7 @@ function _drawMxDbEllipse() {
28989
29007
  _context3.next = 27;
28990
29008
  break;
28991
29009
  }
28992
- getPoint.setMessage("\n\u6307\u5B9A\u692D\u5706\u4E2D\u5FC3\u70B9");
29010
+ getPoint.setMessage("\n\u6307\u5B9A\u692D\u5706\u4E2D\u5FC3");
28993
29011
  getPoint.setKeyWords("");
28994
29012
  _context3.next = 22;
28995
29013
  return getPoint.go();
@@ -29074,9 +29092,10 @@ function _drawMxDbEllipse() {
29074
29092
  }
29075
29093
  getDist.setMessage(_ML_String("EllipticalArc_startAngle", "\u6307\u5B9A\u8D77\u70B9\u89D2\u5EA6"));
29076
29094
  getDist.setKeyWords("");
29077
- angle = angleTo(center.x, center.y, point1.x, point1.y);
29095
+ offsetAngle = Math.atan2(majorAxis.y, majorAxis.x) - Math.PI / 2;
29078
29096
  getDist.setUserDraw(function (currentPoint, pWorldDraw) {
29079
- startAngle = angleTo(center.x, center.y, currentPoint.x, currentPoint.y) - angle - Math.PI;
29097
+ var angle = Math.atan2(currentPoint.y - center.y, currentPoint.x - center.x);
29098
+ startAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
29080
29099
  drawEllipse(currentPoint, pWorldDraw);
29081
29100
  });
29082
29101
  _context3.next = 60;
@@ -29098,7 +29117,11 @@ function _drawMxDbEllipse() {
29098
29117
  getDist.setMessage(_ML_String("EllipticalArc_endAngle", "\u6307\u5B9A\u7AEF\u70B9\u89D2\u5EA6"));
29099
29118
  getDist.setKeyWords("[\u5939\u89D2(I)]");
29100
29119
  getDist.setUserDraw(function (currentPoint, pWorldDraw) {
29101
- endAngle = angleTo(center.x, center.y, currentPoint.x, currentPoint.y) - angle - Math.PI;
29120
+ var angle = Math.atan2(currentPoint.y - center.y, currentPoint.x - center.x);
29121
+ endAngle = (angle - offsetAngle + Math.PI * 2) % (Math.PI * 2);
29122
+ if (endAngle < startAngle) {
29123
+ endAngle += Math.PI * 2;
29124
+ }
29102
29125
  drawEllipse(currentPoint, pWorldDraw);
29103
29126
  });
29104
29127
  _context3.next = 70;