Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getEdgeWidth() {
return (
util.getNumber(this.style, 'width', this.defaultWidth) +
Math.max(0, this.strokeWidth - 1)
)
}
}
getLabelMargins(rect: Rectangle) {
if (util.getBoolean(this.style, 'boundedLbl', false)) {
const s = util.getNumber(this.style, 'factor', this.factor) * this.scale
return new Rectangle(s, s, 0, 0)
}
return null
}
drawNodeShape(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
const factor = util.getNumber(this.style, 'factor', this.factor)
const darkOpacity = util.getNumber(
this.style,
'darkOpacity',
this.darkOpacity,
)
const s = Math.max(0, Math.min(w, Math.min(h, factor)))
const op = Math.max(-1, Math.min(1, darkOpacity))
c.translate(x, y)
c.begin()
c.moveTo(0, 0)
c.lineTo(w - s, 0)
c.lineTo(w, s)
c.lineTo(w, h)
c.lineTo(0, h)
c.lineTo(0, 0)
c.close()
redrawPath(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
const arcSize = this.getLineArcSize()
const factor = util.getNumber(this.style, 'factor', this.factor)
const s = Math.max(0, Math.min(w, Math.min(h, factor)))
this.drawPoints(
c,
[
new Point(s, 0),
new Point(w, 0),
new Point(w, h),
new Point(0, h),
new Point(0, s),
],
this.rounded,
arcSize,
true,
)
getLabelMargins() {
return new Rectangle(
0,
0,
0,
util.getNumber(this.style, 'factor', this.factor) * this.scale,
)
}
getEdgeWidth() {
return (
util.getNumber(this.style, 'width', this.defaultWidth) +
Math.max(0, this.strokeWidth - 1)
)
}
}
drawNodeShape(c: SvgCanvas2D, x: number, y: number, w: number, h: number) {
const factor = util.getNumber(this.style, 'factor', this.factor)
const darkOpacity = util.getNumber(
this.style,
'darkOpacity',
this.darkOpacity,
)
const darkOpacity2 = util.getNumber(
this.style,
'darkOpacity2',
this.darkOpacity2,
)
const s = Math.max(0, Math.min(w, Math.min(h, factor)))
const op = Math.max(-1, Math.min(1, darkOpacity))
const op2 = Math.max(-1, Math.min(1, darkOpacity2))
c.translate(x, y)
c.begin()
c.moveTo(0, 0)
getEndArrowWidth() {
return (
this.getEdgeWidth() +
util.getNumber(this.style, 'endWidth', this.defaultArrowWidth)
)
}