Skip to content

Commit

Permalink
added usefull variable that gives last known index of path
Browse files Browse the repository at this point in the history
  • Loading branch information
DanieLazarLDAPPS committed Sep 2, 2019
1 parent 326567c commit 0deaec2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ export class DefaultLinkSegmentWidget extends React.Component<DefaultLinkSegment
);

const Top = React.cloneElement(Bottom, {
...this.props.extras,
strokeLinecap: 'round',
onMouseLeave: () => {
this.props.onSelection(false);
},
onMouseEnter: () => {
this.props.onSelection(true);
},
...this.props.extras,
ref: null,
'data-linkid': this.props.link.getID(),
strokeOpacity: this.props.selected ? 0.1 : 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { DefaultLinkModel, DefaultLinkModelOptions } from '@projectstorm/react-d
import { RightAngleLinkFactory } from './RightAngleLinkFactory';

export class RightAngleLinkModel extends DefaultLinkModel {
constructor(options: DefaultLinkModelOptions = {}) {
lastHoverIndexOfPath: number;
constructor(options: DefaultLinkModelOptions = { }) {
super({
type: RightAngleLinkFactory.NAME,
...options
});
this.lastHoverIndexOfPath = 0;
}

performanceTune() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ export class RightAngleLinkWidget extends React.Component<RightAngleLinkProps, R
window.addEventListener('mousemove', this.handleMove);
window.addEventListener('mouseup', this.handleUp);
}
},
onMouseEnter: (event: MouseEvent) => {
this.setState({ selected: true });
this.props.link.lastHoverIndexOfPath = j;
}
},
j
Expand Down

0 comments on commit 0deaec2

Please sign in to comment.