Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
c.lineTo(0, h / 3)
c.moveTo(w / 2, h / 3)
c.lineTo(w, h / 3)
// Legs
c.moveTo(w / 2, (2 * h) / 3)
c.lineTo(0, h)
c.moveTo(w / 2, (2 * h) / 3)
c.lineTo(w, h)
c.end()
c.stroke()
}
}
Shape.register('umlActor', UmlActorShape)
}
const p1 = new Point(cx, cy)
if (orthogonal) {
if (next.x < x || next.x > x + w) {
p1.y = next.y
} else {
p1.x = next.x
}
}
return util.getPerimeterPoint(points, p1, next) as Point
}
Shape.register('step', StepShape)
Perimeter.register('stepPerimeter', stepPerimeter)
}
}
export class XorShape extends Shape.Actor {
redrawPath(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
c.moveTo(0, 0)
c.quadTo(w, 0, w, h / 2)
c.quadTo(w, h, 0, h)
c.quadTo(w / 2, h / 2, 0, 0)
c.close()
c.end()
}
}
Shape.register('or', OrShape)
Shape.register('xor', XorShape)
c.fill()
}
c.begin()
c.moveTo(s, h)
c.lineTo(s, s)
c.lineTo(0, 0)
c.moveTo(s, s)
c.lineTo(w, s)
c.end()
c.stroke()
}
}
}
Shape.register('cube', CubeShape)
getEndArrowWidth() {
return (
this.getEdgeWidth() +
util.getNumber(this.style, 'endWidth', this.defaultArrowWidth)
)
}
getEdgeWidth() {
return (
util.getNumber(this.style, 'width', this.defaultWidth) +
Math.max(0, this.strokeWidth - 1)
)
}
}
Shape.register('flexArrow', FlexArrowShape)
bounds: Rectangle,
state: State,
next: Point,
orthogonal: boolean,
) {
const factor = getFactor(
state.style,
CalloutShape.prototype.factor,
bounds.height,
)
const rect = new Rectangle(0, 0, 0, factor * state.view.scale)
const directedBounds = util.getDirectedBounds(bounds, rect, state.style)
return Perimeter.rectangle(directedBounds, state, next, orthogonal)
}
Shape.register('callout', CalloutShape)
Perimeter.register('calloutPerimeter', calloutPerimeter)
new Point(s, 0),
new Point(w, 0),
new Point(w, h),
new Point(0, h),
new Point(0, s),
],
this.rounded,
arcSize,
true,
)
c.end()
}
}
Shape.register('card', CardShape)
]
}
const center = bounds.getCenter()
if (orthogonal) {
if (next.x < x || next.x > x + w) {
center.y = next.y
} else {
center.x = next.x
}
}
return util.getPerimeterPoint(points, center, next) as Point
}
Shape.register('parallelogram', ParallelogramShape)
Perimeter.register('parallelogramPerimeter', parallelogramPerimeter)
drawForeground(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
const inset = this.getInset(w, h, true)
c.begin()
c.moveTo(x + inset, y)
c.lineTo(x + inset, y + h)
c.moveTo(x + w - inset, y)
c.lineTo(x + w - inset, y + h)
c.stroke()
super.drawForeground(c, x, y, w, h)
}
}
Shape.register('process', ProcessShape)
c.end()
}
}
export class XorShape extends Shape.Actor {
redrawPath(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
c.moveTo(0, 0)
c.quadTo(w, 0, w, h / 2)
c.quadTo(w, h, 0, h)
c.quadTo(w / 2, h / 2, 0, 0)
c.close()
c.end()
}
}
Shape.register('or', OrShape)
Shape.register('xor', XorShape)