Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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)
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('trapezoid', TrapezoidShape)
Perimeter.register('trapezoidPerimeter', trapezoidPerimeter)
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)
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)