Mercurial > kallithea
changeset 1863:941437fdfe59 beta
graph: bezier curve for curved merge lines
author | Aras Pranckevicius <aras@unity3d.com> |
---|---|
date | Sun, 08 Jan 2012 12:34:09 +0200 |
parents | 2a159aa3ed2d |
children | baef43bc457c bd7e95937acd |
files | rhodecode/public/js/graph.js |
diffstat | 1 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/public/js/graph.js Sun Jan 08 12:19:43 2012 +0200 +++ b/rhodecode/public/js/graph.js Sun Jan 08 12:34:09 2012 +0200 @@ -107,10 +107,20 @@ this.ctx.beginPath(); this.ctx.moveTo(x, y); - y += row.offsetHeight; - x = pad-((1 + this.box_size * end) + this.bg_height-2); - this.ctx.lineTo(x,y+extra,3); + if (start == end) + { + x = pad-((1 + this.box_size * end) + this.bg_height-2); + y += row.offsetHeight; + this.ctx.lineTo(x,y+extra,3); + } + else + { + var x2 = pad-((1 + this.box_size * end) + this.bg_height-2); + var y2 = y + row.offsetHeight; + var ymid = (y+y2) / 2; + this.ctx.bezierCurveTo (x,ymid,x2,ymid,x2,y2); + } this.ctx.stroke(); }