@meta2d/sequence-diagram
Advanced tools
Comparing version 1.0.0 to 1.0.1
export * from './src/focus'; | ||
export * from './src/lifeline'; | ||
export * from './src/register'; |
@@ -0,0 +0,0 @@ export * from './src/focus'; |
{ | ||
"name": "@meta2d/sequence-diagram", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The sequence library based on le5le meta2d.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
import { Pen } from '../../core/src/pen'; | ||
import { Pen } from '@meta2d/core/src/pen'; | ||
export declare function focus(pen: Pen, ctx?: CanvasRenderingContext2D): Path2D; |
export function focus(pen, ctx) { | ||
var path = !ctx ? new Path2D() : ctx; | ||
var _a = pen.calculative.worldRect, x = _a.x, y = _a.y, width = _a.width, height = _a.height; | ||
const path = !ctx ? new Path2D() : ctx; | ||
const { x, y, width, height } = pen.calculative.worldRect; | ||
path.rect(x, y, width, height); | ||
@@ -5,0 +5,0 @@ path.closePath(); |
import { Pen } from '@meta2d/core'; | ||
export declare function lifeline(ctx: CanvasRenderingContext2D, pen: Pen): void; |
export function lifeline(ctx, pen) { | ||
var _a; | ||
var headHeight = (_a = pen.headHeight) !== null && _a !== void 0 ? _a : 50; | ||
var _b = pen.calculative.worldRect, x = _b.x, y = _b.y, width = _b.width, height = _b.height, ey = _b.ey; | ||
var wr = pen.calculative.borderRadius || 0, hr = wr; | ||
const headHeight = pen.headHeight ?? 50; | ||
const { x, y, width, height, ey } = pen.calculative.worldRect; | ||
let wr = pen.calculative.borderRadius || 0, hr = wr; | ||
if (pen.calculative.borderRadius < 1) { | ||
@@ -10,3 +9,3 @@ wr *= width; | ||
} | ||
var r = wr < hr ? wr : hr; | ||
let r = wr < hr ? wr : hr; | ||
if (width < 2 * r) { | ||
@@ -30,6 +29,5 @@ r = width / 2; | ||
ctx.setLineDash([7, 7]); | ||
var middle = x + width / 2; | ||
const middle = x + width / 2; | ||
ctx.moveTo(middle, y + headHeight + 1); | ||
ctx.lineTo(middle, ey); | ||
ctx.closePath(); | ||
ctx.stroke(); | ||
@@ -36,0 +34,0 @@ ctx.restore(); |
@@ -0,0 +0,0 @@ import { Pen } from '@meta2d/core'; |
@@ -10,5 +10,5 @@ import { focus } from './focus'; | ||
return { | ||
lifeline: lifeline, | ||
lifeline, | ||
}; | ||
} | ||
//# sourceMappingURL=register.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5923
69