Skip to content

Commit

Permalink
fix: revert changes Path.gitPoint static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechan99 committed Jul 19, 2024
1 parent e7dfe86 commit c6a09c8
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions src/shapes/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Factory } from '../Factory';
import { Shape, ShapeConfig } from '../Shape';
import { _registerNode } from '../Global';

import { GetSet, PathSegment, Vector2d } from '../types';
import { GetSet, PathSegment } from '../types';
import {
getCubicArcLength,
getQuadraticArcLength,
Expand Down Expand Up @@ -235,10 +235,7 @@ export class Path extends Shape<PathConfig> {
return pathLength;
}

static getPointAtLengthOfDataArray(
length: number,
dataArray
): Vector2d | null {
static getPointAtLengthOfDataArray(length: number, dataArray) {
var point,
i = 0,
ii = dataArray.length;
Expand Down Expand Up @@ -322,7 +319,7 @@ export class Path extends Shape<PathConfig> {
return null;
}

static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX?, fromY?): Vector2d {
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX?, fromY?) {
fromX = fromX ?? P1x;
fromY = fromY ?? P1y;

Expand Down Expand Up @@ -357,17 +354,7 @@ export class Path extends Shape<PathConfig> {
return { x: ix + adjustedRun, y: iy + adjustedRise };
}

static getPointOnCubicBezier(
pct,
P1x,
P1y,
P2x,
P2y,
P3x,
P3y,
P4x,
P4y
): Vector2d {
static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
function CB1(t) {
return t * t * t;
}
Expand All @@ -388,15 +375,7 @@ export class Path extends Shape<PathConfig> {
y: y,
};
}
static getPointOnQuadraticBezier(
pct,
P1x,
P1y,
P2x,
P2y,
P3x,
P3y
): Vector2d {
static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
function QB1(t) {
return t * t;
}
Expand Down

0 comments on commit c6a09c8

Please sign in to comment.