@leafer/core 2.1.6 → 2.1.7

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/lib/core.cjs CHANGED
@@ -765,15 +765,15 @@ const PointHelper = {
765
765
  t.x += (t.x - origin.x) * (scaleX - 1);
766
766
  t.y += (t.y - origin.y) * (scaleY - 1);
767
767
  },
768
- rotate(t, rotation, origin) {
768
+ rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
769
769
  if (!origin) origin = P$5.defaultPoint;
770
770
  rotation *= OneRadian;
771
771
  const cosR = cos$2(rotation);
772
772
  const sinR = sin$2(rotation);
773
- const rx = t.x - origin.x;
774
- const ry = t.y - origin.y;
775
- t.x = origin.x + rx * cosR - ry * sinR;
776
- t.y = origin.y + rx * sinR + ry * cosR;
773
+ const rx = (t.x - origin.x) / radiusX;
774
+ const ry = (t.y - origin.y) / radiusY;
775
+ t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
776
+ t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
777
777
  },
778
778
  tempToInnerOf(t, matrix) {
779
779
  const {tempPoint: temp} = P$5;
@@ -833,8 +833,8 @@ const PointHelper = {
833
833
  getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
834
834
  return min$1(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
835
835
  },
836
- getAngle(t, to) {
837
- return getAtan2(t, to) / OneRadian;
836
+ getAngle(t, to, radiusX, radiusY) {
837
+ return getAtan2(t, to, radiusX, radiusY) / OneRadian;
838
838
  },
839
839
  getRotation(t, origin, to, toOrigin) {
840
840
  if (!toOrigin) toOrigin = origin;
@@ -848,8 +848,8 @@ const PointHelper = {
848
848
  const d = toY - toOriginY;
849
849
  return Math.atan2(a * d - b * c, a * c + b * d);
850
850
  },
851
- getAtan2(t, to) {
852
- return atan2$2(to.y - t.y, to.x - t.x);
851
+ getAtan2(t, to, radiusX = 1, radiusY = 1) {
852
+ return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
853
853
  },
854
854
  getDistancePoint(t, to, distance, changeTo, fromTo) {
855
855
  const r = getAtan2(t, to);
@@ -6976,7 +6976,7 @@ class LeafLevelList {
6976
6976
  }
6977
6977
  }
6978
6978
 
6979
- const version = "2.1.6";
6979
+ const version = "2.1.7";
6980
6980
 
6981
6981
  exports.AlignHelper = AlignHelper;
6982
6982
 
package/lib/core.esm.js CHANGED
@@ -763,15 +763,15 @@ const PointHelper = {
763
763
  t.x += (t.x - origin.x) * (scaleX - 1);
764
764
  t.y += (t.y - origin.y) * (scaleY - 1);
765
765
  },
766
- rotate(t, rotation, origin) {
766
+ rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
767
767
  if (!origin) origin = P$5.defaultPoint;
768
768
  rotation *= OneRadian;
769
769
  const cosR = cos$2(rotation);
770
770
  const sinR = sin$2(rotation);
771
- const rx = t.x - origin.x;
772
- const ry = t.y - origin.y;
773
- t.x = origin.x + rx * cosR - ry * sinR;
774
- t.y = origin.y + rx * sinR + ry * cosR;
771
+ const rx = (t.x - origin.x) / radiusX;
772
+ const ry = (t.y - origin.y) / radiusY;
773
+ t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
774
+ t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
775
775
  },
776
776
  tempToInnerOf(t, matrix) {
777
777
  const {tempPoint: temp} = P$5;
@@ -831,8 +831,8 @@ const PointHelper = {
831
831
  getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
832
832
  return min$1(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
833
833
  },
834
- getAngle(t, to) {
835
- return getAtan2(t, to) / OneRadian;
834
+ getAngle(t, to, radiusX, radiusY) {
835
+ return getAtan2(t, to, radiusX, radiusY) / OneRadian;
836
836
  },
837
837
  getRotation(t, origin, to, toOrigin) {
838
838
  if (!toOrigin) toOrigin = origin;
@@ -846,8 +846,8 @@ const PointHelper = {
846
846
  const d = toY - toOriginY;
847
847
  return Math.atan2(a * d - b * c, a * c + b * d);
848
848
  },
849
- getAtan2(t, to) {
850
- return atan2$2(to.y - t.y, to.x - t.x);
849
+ getAtan2(t, to, radiusX = 1, radiusY = 1) {
850
+ return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
851
851
  },
852
852
  getDistancePoint(t, to, distance, changeTo, fromTo) {
853
853
  const r = getAtan2(t, to);
@@ -6974,6 +6974,6 @@ class LeafLevelList {
6974
6974
  }
6975
6975
  }
6976
6976
 
6977
- const version = "2.1.6";
6977
+ const version = "2.1.7";
6978
6978
 
6979
6979
  export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, FourNumberHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, UnitConvertHelper, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };