UNPKG

@visactor/vrender-core

Version:

```typescript import { xxx } from '@visactor/vrender-core'; ```

23 lines (19 loc) 804 B
import { BaseSymbol } from "./base"; export function wedge(ctx, r, transX, transY) { const h = 2 * r; return ctx.moveTo(transX, -r + transY), ctx.lineTo(h / 3 / 2 + transX, r + transY), ctx.lineTo(-h / 3 / 2 + transX, r + transY), ctx.closePath(), !0; } export class WedgeSymbol extends BaseSymbol { constructor() { super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"; } draw(ctx, size, transX, transY) { return wedge(ctx, this.parseSize(size) / 2, transX, transY); } drawOffset(ctx, size, transX, transY, offset) { return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY); } } export default new WedgeSymbol; //# sourceMappingURL=wedge.js.map