Skip to content

Commit

Permalink
middle mouse on graph is now dragging the background instead of the n…
Browse files Browse the repository at this point in the history
…odes in the foreground
  • Loading branch information
M-Wicenec committed Oct 12, 2023
1 parent b08f88c commit fe7210b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/GraphRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ export class GraphRenderer {
}
})


//construct resizing
if(node.getParentKey() != null){
if(oldParent.getRadius()>GraphRenderer.NodeParentRadiusPreDrag+GraphConfig.CONSTRUCT_DRAG_OUT_DISTANCE){
Expand Down Expand Up @@ -571,7 +570,7 @@ export class GraphRenderer {

static startDrag = (node: Node, event: MouseEvent) : void => {
const eagle = Eagle.getInstance();
if(node === null){
if(node === null || event.which === 2){
eagle.isDragging(true);

} else if(!node.isEmbedded()){
Expand All @@ -587,8 +586,8 @@ export class GraphRenderer {
}
}

//select handlers

//select handlers
if(node !== null){
// check if shift key is down, if so, add or remove selected node to/from current selection
if (node !== null && event.shiftKey && !event.altKey){
Expand Down
1 change: 0 additions & 1 deletion src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ export class Utils {
}else{
$('#confirmModalDontShowAgain button').text('check_box_outline_blank')
}
console.log($('#confirmModalDontShowAgain button').text())
})
}

Expand Down
5 changes: 4 additions & 1 deletion src/graphConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const colors: { name: string; color: string; }[] = [
color: '#d4d4d4'
},{
name: 'constructBg',
color: '#0000001f'
color: '#0000001a'
},{
name: 'embeddedApp',
color: '#c5c5c5'
},{
name: 'constructIcon',
color: '#0000000f'
Expand Down

0 comments on commit fe7210b

Please sign in to comment.