@leafer-in/motion-path 1.4.2 → 1.5.0

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.
@@ -100,7 +100,7 @@ export const HighCurveHelper = {
100
100
  toY = data[i + 2]
101
101
  distance = segments[index]
102
102
 
103
- if (total + distance > motionDistance || !distanceData.total) {
103
+ if (total + distance >= motionDistance || !distanceData.total) {
104
104
  if (!i) x = toX, y = toY // first M
105
105
  tempFrom.x = x
106
106
  tempFrom.y = y
@@ -120,7 +120,7 @@ export const HighCurveHelper = {
120
120
  toY = data[i + 6]
121
121
  distance = segments[index]
122
122
 
123
- if (total + distance > motionDistance) {
123
+ if (total + distance >= motionDistance) {
124
124
  x1 = data[i + 1], y1 = data[i + 2], x2 = data[i + 3], y2 = data[i + 4]
125
125
  t = HighBezierHelper.getT(motionDistance - total, distance, x, y, x1, y1, x2, y2, toX, toY, motionPrecision)
126
126
  BezierHelper.getPointAndSet(t, x, y, x1, y1, x2, y2, toX, toY, to)
@@ -163,7 +163,7 @@ export const HighCurveHelper = {
163
163
  toY = data[i + 2]
164
164
  distance = segments[index]
165
165
 
166
- if (total + distance > motionDistance || !distanceData.total) {
166
+ if (total + distance >= motionDistance || !distanceData.total) {
167
167
  if (!i) x = toX, y = toY // first M
168
168
  tempFrom.x = x
169
169
  tempFrom.y = y
@@ -185,7 +185,7 @@ export const HighCurveHelper = {
185
185
  toY = data[i + 6]
186
186
  distance = segments[index]
187
187
 
188
- if (total + distance > motionDistance) {
188
+ if (total + distance >= motionDistance) {
189
189
  t = HighBezierHelper.getT(motionDistance - total, distance, x, y, x1, y1, x2, y2, toX, toY, motionPrecision)
190
190
  HighBezierHelper.cut(path, t, x, y, x1, y1, x2, y2, toX, toY)
191
191
  return path
package/src/index.ts CHANGED
@@ -31,11 +31,11 @@ const { updateBounds } = BranchHelper
31
31
 
32
32
 
33
33
  // addAttr
34
- motionPathType()(ui, 'motionPath')
35
- motionPathType(1)(ui, 'motionPrecision')
34
+ UI.addAttr('motionPath', undefined, motionPathType)
35
+ UI.addAttr('motionPrecision', 1, motionPathType)
36
36
 
37
- motionPathType()(ui, 'motion')
38
- motionPathType(true)(ui, 'motionRotation')
37
+ UI.addAttr('motion', undefined, motionPathType)
38
+ UI.addAttr('motionRotation', true, motionPathType)
39
39
 
40
40
 
41
41
  ui.getMotionPathData = function (): IMotionPathData {