Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/symbols/Arrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const Arrow: FC<ArrowProps> = ({
onPointerDown={event => {
// context menu controls
if (event.nativeEvent.buttons === 2) {
event.nativeEvent.preventDefault();
event.stopPropagation();
onContextMenu();
}
Expand Down
1 change: 1 addition & 0 deletions src/symbols/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const Line: FC<LineProps> = ({
onPointerDown={event => {
// context menu controls
if (event.nativeEvent.buttons === 2) {
event.nativeEvent.preventDefault();
event.stopPropagation();
onContextMenu();
}
Expand Down
5 changes: 3 additions & 2 deletions src/symbols/edges/Edge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ export const Edge: FC<EdgeProps> = ({

const removeContextMenu = useCallback(
(edgeId: string) => {
edgeContextMenus.delete(edgeId);
setEdgeContextMenus(new Set(edgeContextMenus));
const newEdgeContextMenus = new Set(edgeContextMenus);
newEdgeContextMenus.delete(edgeId);
setEdgeContextMenus(newEdgeContextMenus);
},
[edgeContextMenus, setEdgeContextMenus]
);
Expand Down
4 changes: 2 additions & 2 deletions src/symbols/edges/useEdgeGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export function useEdgeGeometry(
}

const fromVector = getVector(from);
const fromOffset = from.size + labelFontSize;
const fromOffset = from.size;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to know why this was removed ? Looks fishy at first glance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this was to fix the difference in size of the arrows when animated={true} and animated={false}, I believe that was a bug: #346

const toVector = getVector(to);
const toOffset = to.size + labelFontSize;
const toOffset = to.size;
let curve = getCurve(
fromVector,
fromOffset,
Expand Down