Commit 0154be8c authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbolizer] Improve effect/control chain exploration

Shortcuts e and c select (and make visible) the next effect/control
node downwards in the chain; ALT+e/c moves upward.

Additionally, the graph bounding box is redetermined every time the
graph is redrawn (instead of only when relayouted).

Bug: v8:7327
Change-Id: If01b16fc25273703e25e429bdc36753a2fa87f7c
Reviewed-on: https://chromium-review.googlesource.com/1064210
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53259}
parent d97d095a
......@@ -489,5 +489,4 @@ function redetermineGraphBoundingBox(graph) {
graph.maxGraphX = graph.maxGraphNodeX +
graph.maxBackEdgeNumber * MINIMUM_EDGE_SEPARATION;
}
......@@ -540,7 +540,7 @@ class GraphView extends View {
var showSelectionFrontierNodes = function (inEdges, filter, select) {
var frontier = graph.getNodeFrontier(state.selection, inEdges, filter);
if (frontier != undefined) {
if (frontier != undefined && frontier.size) {
if (select) {
if (!d3.event.shiftKey) {
state.selection.clear();
......@@ -585,13 +585,13 @@ class GraphView extends View {
break;
case 67:
// 'c'
showSelectionFrontierNodes(!d3.event.altKey,
showSelectionFrontierNodes(d3.event.altKey,
(edge, index) => { return edge.type == 'control'; },
true);
break;
case 69:
// 'e'
showSelectionFrontierNodes(!d3.event.altKey,
showSelectionFrontierNodes(d3.event.altKey,
(edge, index) => { return edge.type == 'effect'; },
true);
break;
......@@ -892,6 +892,7 @@ class GraphView extends View {
});
graph.svg.style.height = '100%';
redetermineGraphBoundingBox(this);
}
getVisibleTranslation(translate, scale) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment