✨ Fixed offset issue when Cp lies on start/end
See https://github.com/Pomax/bezierjs/issues/37#issuecomment-410810976
This commit is contained in:
parent
4c81d41ab8
commit
8051a48880
2 changed files with 74 additions and 9 deletions
|
@ -99,6 +99,12 @@ Point.prototype.shiftTowards = function(that, distance) {
|
|||
return this.shift(this.angle(that), distance);
|
||||
};
|
||||
|
||||
/** Checks whether this has the same coordinates as that */
|
||||
Point.prototype.sitsOn = function(that) {
|
||||
if (this.x === that.x && this.y === that.y) return true;
|
||||
else return false;
|
||||
};
|
||||
|
||||
/** Shifts this point fraction of the distance towards that point */
|
||||
Point.prototype.shiftFractionTowards = function(that, fraction) {
|
||||
return this.shiftTowards(that, this.dist(that) * fraction);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue