laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
45 lines (44 loc) • 999 B
JavaScript
"use client";
class s {
constructor(t, i) {
this._context = t, this._x = i;
}
areaStart() {
this._line = 0;
}
areaEnd() {
this._line = NaN;
}
lineStart() {
this._point = 0;
}
lineEnd() {
(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
}
point(t, i) {
switch (t = +t, i = +i, this._point) {
case 0: {
this._point = 1, this._line ? this._context.lineTo(t, i) : this._context.moveTo(t, i);
break;
}
case 1:
this._point = 2;
// falls through
default: {
this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + t) / 2, this._y0, this._x0, i, t, i) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + i) / 2, t, this._y0, t, i);
break;
}
}
this._x0 = t, this._y0 = i;
}
}
function n(e) {
return new s(e, !0);
}
function h(e) {
return new s(e, !1);
}
export {
n as bumpX,
h as bumpY
};