Changeset - 362652e72e29
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-09-08 13:38:56
madski@unity3d.com
graph: don't draw edges to roots as "dead ends"

Roots and dead ends both don't have outgoing edges. The difference is that
roots will have the dot of the line - dead ends will not.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/graph.js
Show inline comments
 
@@ -109,24 +109,26 @@ function BranchRenderer(canvas_id, conte
 
				// we want to fade away this line
 
				var dead_end = true;
 
				if (next != null) {
 
					nextdata = data[i+1];
 
					next_l = nextdata[1];
 
					found = false;
 
					for (var k=0; k < next_l.length; ++k) {
 
						if (next_l[k][0] == end) {
 
							dead_end = false;
 
							break;
 
						}
 
					}
 
					if (nextdata[0][0] == end) // this is a root - not a dead end
 
						dead_end = false;
 
				}
 

	
 
				if (dead_end) {
 
					var gradient = this.ctx.createLinearGradient(x,rowY,x,nextY);
 
					gradient.addColorStop(0,this.calcColor(color, 0.0, 0.65));
 
					gradient.addColorStop(1,this.calcColor(color, 1.0, 0.0));
 
					this.ctx.strokeStyle = gradient;
 
					this.ctx.fillStyle = gradient;
 
				}
 
				// if this is a merge of differently
 
				// colored line, make it a gradient towards
 
				// the merged color
0 comments (0 inline, 0 general)