Open
Description
Hi,
Thanks for making this library!
There is a piece of functionality that we were using to customize the way points are added to the lines that connect the widgets. We only want this to trigger when the user does a mouse click in combination with pressing the CTRL-key.
The way we did this is by overriding the addPointToLink
function:
import { DefaultLinkWidget, PointModel } from '@projectstorm/react-diagrams'
class BaseLinkWidget extends DefaultLinkWidget {
addPointToLink = (event: any, index: number) => {
if (
event.ctrlKey &&
!this.props.link.isLocked() &&
this.props.link.getPoints().length - 1 <= this.props.diagramEngine.getMaxNumberPointsPerLink()
) {
const point = new PointModel({
link: this.props.link,
position: this.props.diagramEngine.getRelativeMousePoint(event)
})
this.props.link.addPoint(point, index)
event.persist()
event.stopPropagation()
this.forceUpdate(() => {
this.props.diagramEngine.getActionEventBus().fireAction({
event,
model: point
})
})
}
}
}
export default BaseLinkWidget
This is no longer possible since the following commit: 20766f5
Can this functionality be added back or be provided in another way?
Thanks in advance!
Metadata
Assignees
Labels
No labels
Activity