mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix: revert changes Path.gitPoint static methods
This commit is contained in:
parent
e7dfe86a39
commit
c6a09c8857
@ -2,7 +2,7 @@ import { Factory } from '../Factory';
|
|||||||
import { Shape, ShapeConfig } from '../Shape';
|
import { Shape, ShapeConfig } from '../Shape';
|
||||||
import { _registerNode } from '../Global';
|
import { _registerNode } from '../Global';
|
||||||
|
|
||||||
import { GetSet, PathSegment, Vector2d } from '../types';
|
import { GetSet, PathSegment } from '../types';
|
||||||
import {
|
import {
|
||||||
getCubicArcLength,
|
getCubicArcLength,
|
||||||
getQuadraticArcLength,
|
getQuadraticArcLength,
|
||||||
@ -235,10 +235,7 @@ export class Path extends Shape<PathConfig> {
|
|||||||
return pathLength;
|
return pathLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointAtLengthOfDataArray(
|
static getPointAtLengthOfDataArray(length: number, dataArray) {
|
||||||
length: number,
|
|
||||||
dataArray
|
|
||||||
): Vector2d | null {
|
|
||||||
var point,
|
var point,
|
||||||
i = 0,
|
i = 0,
|
||||||
ii = dataArray.length;
|
ii = dataArray.length;
|
||||||
@ -322,7 +319,7 @@ export class Path extends Shape<PathConfig> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX?, fromY?): Vector2d {
|
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX?, fromY?) {
|
||||||
fromX = fromX ?? P1x;
|
fromX = fromX ?? P1x;
|
||||||
fromY = fromY ?? P1y;
|
fromY = fromY ?? P1y;
|
||||||
|
|
||||||
@ -357,17 +354,7 @@ export class Path extends Shape<PathConfig> {
|
|||||||
return { x: ix + adjustedRun, y: iy + adjustedRise };
|
return { x: ix + adjustedRun, y: iy + adjustedRise };
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPointOnCubicBezier(
|
static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
|
||||||
pct,
|
|
||||||
P1x,
|
|
||||||
P1y,
|
|
||||||
P2x,
|
|
||||||
P2y,
|
|
||||||
P3x,
|
|
||||||
P3y,
|
|
||||||
P4x,
|
|
||||||
P4y
|
|
||||||
): Vector2d {
|
|
||||||
function CB1(t) {
|
function CB1(t) {
|
||||||
return t * t * t;
|
return t * t * t;
|
||||||
}
|
}
|
||||||
@ -388,15 +375,7 @@ export class Path extends Shape<PathConfig> {
|
|||||||
y: y,
|
y: y,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
static getPointOnQuadraticBezier(
|
static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
|
||||||
pct,
|
|
||||||
P1x,
|
|
||||||
P1y,
|
|
||||||
P2x,
|
|
||||||
P2y,
|
|
||||||
P3x,
|
|
||||||
P3y
|
|
||||||
): Vector2d {
|
|
||||||
function QB1(t) {
|
function QB1(t) {
|
||||||
return t * t;
|
return t * t;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user