fabric 4.6.0 → 5.0.0-browser

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/src/util/path.js CHANGED
@@ -507,15 +507,15 @@
507
507
  p, nextLen, nextStep = 0.01, angleFinder = segInfo.angleFinder, lastPerc;
508
508
  // nextStep > 0.0001 covers 0.00015625 that 1/64th of 1/100
509
509
  // the path
510
- while (tmpLen < distance && perc <= 1 && nextStep > 0.0001) {
510
+ while (tmpLen < distance && nextStep > 0.0001) {
511
511
  p = iterator(perc);
512
512
  lastPerc = perc;
513
513
  nextLen = calcLineLength(tempP.x, tempP.y, p.x, p.y);
514
514
  // compare tmpLen each cycle with distance, decide next perc to test.
515
515
  if ((nextLen + tmpLen) > distance) {
516
516
  // we discard this step and we make smaller steps.
517
- nextStep /= 2;
518
517
  perc -= nextStep;
518
+ nextStep /= 2;
519
519
  }
520
520
  else {
521
521
  tempP = p;
@@ -811,50 +811,6 @@
811
811
  });
812
812
  }
813
813
 
814
- /**
815
- * Calculate bounding box of a elliptic-arc
816
- * @deprecated
817
- * @param {Number} fx start point of arc
818
- * @param {Number} fy
819
- * @param {Number} rx horizontal radius
820
- * @param {Number} ry vertical radius
821
- * @param {Number} rot angle of horizontal axis
822
- * @param {Number} large 1 or 0, whatever the arc is the big or the small on the 2 points
823
- * @param {Number} sweep 1 or 0, 1 clockwise or counterclockwise direction
824
- * @param {Number} tx end point of arc
825
- * @param {Number} ty
826
- */
827
- function getBoundsOfArc(fx, fy, rx, ry, rot, large, sweep, tx, ty) {
828
-
829
- var fromX = 0, fromY = 0, bound, bounds = [],
830
- segs = arcToSegments(tx - fx, ty - fy, rx, ry, large, sweep, rot);
831
-
832
- for (var i = 0, len = segs.length; i < len; i++) {
833
- bound = getBoundsOfCurve(fromX, fromY, segs[i][1], segs[i][2], segs[i][3], segs[i][4], segs[i][5], segs[i][6]);
834
- bounds.push({ x: bound[0].x + fx, y: bound[0].y + fy });
835
- bounds.push({ x: bound[1].x + fx, y: bound[1].y + fy });
836
- fromX = segs[i][5];
837
- fromY = segs[i][6];
838
- }
839
- return bounds;
840
- };
841
-
842
- /**
843
- * Draws arc
844
- * @deprecated
845
- * @param {CanvasRenderingContext2D} ctx
846
- * @param {Number} fx
847
- * @param {Number} fy
848
- * @param {Array} coords coords of the arc, without the front 'A/a'
849
- */
850
- function drawArc(ctx, fx, fy, coords) {
851
- coords = coords.slice(0).unshift('X'); // command A or a does not matter
852
- var beziers = fromArcToBeziers(fx, fy, coords);
853
- beziers.forEach(function(bezier) {
854
- ctx.bezierCurveTo.apply(ctx, bezier.slice(1));
855
- });
856
- };
857
-
858
814
  /**
859
815
  * Join path commands to go back to svg format
860
816
  * @param {Array} pathData fabricJS parsed path commands
@@ -870,14 +826,4 @@
870
826
  fabric.util.getBoundsOfCurve = getBoundsOfCurve;
871
827
  fabric.util.getPointOnPath = getPointOnPath;
872
828
  fabric.util.transformPath = transformPath;
873
- /**
874
- * Typo of `fromArcToBeziers` kept for not breaking the api once corrected.
875
- * Will be removed in fabric 5.0
876
- * @deprecated
877
- */
878
- fabric.util.fromArcToBeizers = fromArcToBeziers;
879
- // kept because we do not want to make breaking changes.
880
- // but useless and deprecated.
881
- fabric.util.getBoundsOfArc = getBoundsOfArc;
882
- fabric.util.drawArc = drawArc;
883
829
  })();