Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/turbolizer/graph-view.js

Issue 2169023002: [turbolizer] Fix a latent bug when dragging a node under another node. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/turbolizer/graph-view.js
diff --git a/tools/turbolizer/graph-view.js b/tools/turbolizer/graph-view.js
index 2baad783c1b8dd205a0752feda296920beb342eb..a53a0e0b4fce4ec97ad6a2a36c52a63ab26ea5ac 100644
--- a/tools/turbolizer/graph-view.js
+++ b/tools/turbolizer/graph-view.js
@@ -469,33 +469,17 @@ class GraphView extends View {
if (!mouseDownNode) return;
- if (mouseDownNode !== d){
- // we're in a different node: create new edge for mousedown edge and add to graph
- var newEdge = {source: mouseDownNode, target: d};
- var filtRes = graph.visibleEdges.filter(function(d){
- if (d.source === newEdge.target && d.target === newEdge.source){
- graph.edges.splice(graph.edges.indexOf(d), 1);
- }
- return d.source === newEdge.source && d.target === newEdge.target;
- });
- if (!filtRes[0].length){
- graph.edges.push(newEdge);
- graph.updateGraphVisibility();
- }
+ if (state.justDragged) {
+ // dragged, not clicked
+ state.justDragged = false;
} else{
- // we're in the same node
- if (state.justDragged) {
- // dragged, not clicked
- state.justDragged = false;
- } else{
- // clicked, not dragged
- var extend = d3.event.shiftKey;
- var selection = graph.state.selection;
- if (!extend) {
- selection.clear();
- }
- selection.select(d3node[0][0], true);
+ // clicked, not dragged
+ var extend = d3.event.shiftKey;
+ var selection = graph.state.selection;
+ if (!extend) {
+ selection.clear();
}
+ selection.select(d3node[0][0], true);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698