Skip to content

Commit 6f2e341

Browse files
author
Philip Guo
committed
minor futzing
1 parent d9c3946 commit 6f2e341

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

PyTutorGAE/js/pytutor.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function ExecutionVisualizer(domRootID, dat, params) {
5353
// cool, we can create a separate jsPlumb instance for each visualization:
5454
this.jsPlumbInstance = jsPlumb.getInstance({
5555
Endpoint: ["Dot", {radius:3}],
56-
EndpointStyles: [{fillStyle: lightGray}, {fillstyle: null} /* make right endpoint invisible */],
56+
EndpointStyles: [{fillStyle: darkBlue}, {fillstyle: null} /* make right endpoint invisible */],
5757
Anchors: ["RightMiddle", "LeftMiddle"],
58-
PaintStyle: {lineWidth:1, strokeStyle: lightGray},
58+
PaintStyle: {lineWidth:1, strokeStyle: darkBlue},
5959

6060
// bezier curve style:
6161
//Connector: [ "Bezier", { curviness:15 }], /* too much 'curviness' causes lines to run together */
@@ -1715,10 +1715,7 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
17151715

17161716

17171717
function highlight_frame(frameID) {
1718-
var allConnections = myViz.jsPlumbInstance.getConnections();
1719-
for (var i = 0; i < allConnections.length; i++) {
1720-
var c = allConnections[i];
1721-
1718+
myViz.jsPlumbInstance.select().each(function(c) {
17221719
// this is VERY VERY fragile code, since it assumes that going up
17231720
// FOUR layers of parent() calls will get you from the source end
17241721
// of the connector to the enclosing stack frame
@@ -1735,12 +1732,7 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
17351732
}
17361733
// for heap->heap connectors
17371734
else if (heapConnectionEndpointIDs.has(c.endpoints[0].elementId)) {
1738-
// then HIGHLIGHT IT!
1739-
c.setPaintStyle({lineWidth:1, strokeStyle: darkBlue});
1740-
c.endpoints[0].setPaintStyle({fillStyle: darkBlue});
1741-
//c.endpoints[1].setVisible(false, true, true); // JUST set right endpoint to be invisible
1742-
1743-
$(c.canvas).css("z-index", 1000); // ... and move it to the VERY FRONT
1735+
// NOP since it's already the color and style we set by default
17441736
}
17451737
else {
17461738
// else unhighlight it
@@ -1750,7 +1742,8 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
17501742

17511743
$(c.canvas).css("z-index", 0);
17521744
}
1753-
}
1745+
});
1746+
17541747

17551748
// clear everything, then just activate this one ...
17561749
myViz.domRoot.find(".stackFrame").removeClass("highlightedStackFrame");

0 commit comments

Comments
 (0)