rename abstract arrow
This commit is contained in:
parent
4629d2e822
commit
fffd758d2c
|
|
@ -1,5 +1,5 @@
|
|||
import { getBoxToBoxArrow } from 'perfect-arrows';
|
||||
import { AbstractArrow } from './abstract-arrow.ts';
|
||||
import { FolkConnection } from './folk-connection.ts';
|
||||
import { getSvgPathFromStroke, pointsOnBezierCurves } from './common/utils.ts';
|
||||
import { getStroke, StrokeOptions } from 'perfect-freehand';
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
export class FolkArrow extends AbstractArrow {
|
||||
export class FolkArrow extends FolkConnection {
|
||||
static override tagName = 'folk-arrow';
|
||||
|
||||
#options: StrokeOptions = {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ function parseCSSSelector(selector: string): string[] {
|
|||
return selector.split('>>>').map((s) => s.trim());
|
||||
}
|
||||
|
||||
export class AbstractArrow extends HTMLElement {
|
||||
static tagName = 'abstract-arrow';
|
||||
export class FolkConnection extends HTMLElement {
|
||||
static tagName = 'folk-connection';
|
||||
|
||||
static define() {
|
||||
if (customElements.get(this.tagName)) return;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { Vector } from './common/Vector.ts';
|
||||
import type { Point } from './common/types.ts';
|
||||
import { AbstractArrow } from './abstract-arrow.ts';
|
||||
import { FolkConnection } from './folk-connection.ts';
|
||||
|
||||
const lerp = (first: number, second: number, percentage: number) => first + (second - first) * percentage;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
export class FolkRope extends AbstractArrow {
|
||||
export class FolkRope extends FolkConnection {
|
||||
static override tagName = 'folk-rope';
|
||||
|
||||
#svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { AbstractArrow } from './abstract-arrow.js';
|
||||
import { FolkConnection } from './folk-connection.js';
|
||||
import { verticesToPolygon } from './common/utils.js';
|
||||
import type { Point } from './common/types.js';
|
||||
export class FolkXanadu extends AbstractArrow {
|
||||
export class FolkXanadu extends FolkConnection {
|
||||
static tagName = 'folk-xanadu';
|
||||
|
||||
render(sourceRect: DOMRectReadOnly, targetRect: DOMRectReadOnly): void {
|
||||
|
|
|
|||
Loading…
Reference in New Issue