Fossil SCM
Draw the upward riser arrow just a short ways, not to the top of screen, for nodes whose next child is off-screen.
Commit
70ba2951f2802a2f76691bb9f04ffddc14b95076
Parent
da4a3b4ffb6447e…
2 files changed
+8
-5
+1
-1
+8
-5
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -327,16 +327,19 @@ | ||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /* |
| 332 | -** Draw a riser from pRow to the top of the graph | |
| 332 | +** pRow has direct children, but they are all off-screen and not | |
| 333 | +** shown on the current graph. Therefore, draw an arrow up from | |
| 334 | +** pRow but terminate it in empty space. | |
| 333 | 335 | */ |
| 334 | -static void riser_to_top(GraphRow *pRow){ | |
| 336 | +static void riserToOffScreenChild(GraphRow *pRow){ | |
| 335 | 337 | u64 mask = BIT(pRow->iRail); |
| 336 | 338 | pRow->aiRiser[pRow->iRail] = 0; |
| 337 | - while( pRow ){ | |
| 339 | + int n = 0; | |
| 340 | + while( pRow && (n++)<3 ){ | |
| 338 | 341 | pRow->railInUse |= mask; |
| 339 | 342 | pRow = pRow->pPrev; |
| 340 | 343 | } |
| 341 | 344 | } |
| 342 | 345 | |
| @@ -477,11 +480,11 @@ | ||
| 477 | 480 | if( pRow->iRail>=0 ){ |
| 478 | 481 | if( pRow->pChild==0 && !pRow->timeWarp ){ |
| 479 | 482 | if( omitDescenders || pRow->isLeaf ){ |
| 480 | 483 | /* no-op */ |
| 481 | 484 | }else{ |
| 482 | - riser_to_top(pRow); | |
| 485 | + riserToOffScreenChild(pRow); | |
| 483 | 486 | } |
| 484 | 487 | } |
| 485 | 488 | continue; |
| 486 | 489 | } |
| 487 | 490 | if( pRow->isDup ){ |
| @@ -520,11 +523,11 @@ | ||
| 520 | 523 | mask = BIT(pRow->iRail); |
| 521 | 524 | pRow->railInUse |= mask; |
| 522 | 525 | if( pRow->pChild ){ |
| 523 | 526 | assignChildrenToRail(pRow); |
| 524 | 527 | }else if( !pRow->isLeaf ){ |
| 525 | - riser_to_top(pRow); | |
| 528 | + riserToOffScreenChild(pRow); | |
| 526 | 529 | } |
| 527 | 530 | if( pParent ){ |
| 528 | 531 | for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){ |
| 529 | 532 | pLoop->railInUse |= mask; |
| 530 | 533 | } |
| 531 | 534 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -327,16 +327,19 @@ | |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** Draw a riser from pRow to the top of the graph |
| 333 | */ |
| 334 | static void riser_to_top(GraphRow *pRow){ |
| 335 | u64 mask = BIT(pRow->iRail); |
| 336 | pRow->aiRiser[pRow->iRail] = 0; |
| 337 | while( pRow ){ |
| 338 | pRow->railInUse |= mask; |
| 339 | pRow = pRow->pPrev; |
| 340 | } |
| 341 | } |
| 342 | |
| @@ -477,11 +480,11 @@ | |
| 477 | if( pRow->iRail>=0 ){ |
| 478 | if( pRow->pChild==0 && !pRow->timeWarp ){ |
| 479 | if( omitDescenders || pRow->isLeaf ){ |
| 480 | /* no-op */ |
| 481 | }else{ |
| 482 | riser_to_top(pRow); |
| 483 | } |
| 484 | } |
| 485 | continue; |
| 486 | } |
| 487 | if( pRow->isDup ){ |
| @@ -520,11 +523,11 @@ | |
| 520 | mask = BIT(pRow->iRail); |
| 521 | pRow->railInUse |= mask; |
| 522 | if( pRow->pChild ){ |
| 523 | assignChildrenToRail(pRow); |
| 524 | }else if( !pRow->isLeaf ){ |
| 525 | riser_to_top(pRow); |
| 526 | } |
| 527 | if( pParent ){ |
| 528 | for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){ |
| 529 | pLoop->railInUse |= mask; |
| 530 | } |
| 531 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -327,16 +327,19 @@ | |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | /* |
| 332 | ** pRow has direct children, but they are all off-screen and not |
| 333 | ** shown on the current graph. Therefore, draw an arrow up from |
| 334 | ** pRow but terminate it in empty space. |
| 335 | */ |
| 336 | static void riserToOffScreenChild(GraphRow *pRow){ |
| 337 | u64 mask = BIT(pRow->iRail); |
| 338 | pRow->aiRiser[pRow->iRail] = 0; |
| 339 | int n = 0; |
| 340 | while( pRow && (n++)<3 ){ |
| 341 | pRow->railInUse |= mask; |
| 342 | pRow = pRow->pPrev; |
| 343 | } |
| 344 | } |
| 345 | |
| @@ -477,11 +480,11 @@ | |
| 480 | if( pRow->iRail>=0 ){ |
| 481 | if( pRow->pChild==0 && !pRow->timeWarp ){ |
| 482 | if( omitDescenders || pRow->isLeaf ){ |
| 483 | /* no-op */ |
| 484 | }else{ |
| 485 | riserToOffScreenChild(pRow); |
| 486 | } |
| 487 | } |
| 488 | continue; |
| 489 | } |
| 490 | if( pRow->isDup ){ |
| @@ -520,11 +523,11 @@ | |
| 523 | mask = BIT(pRow->iRail); |
| 524 | pRow->railInUse |= mask; |
| 525 | if( pRow->pChild ){ |
| 526 | assignChildrenToRail(pRow); |
| 527 | }else if( !pRow->isLeaf ){ |
| 528 | riserToOffScreenChild(pRow); |
| 529 | } |
| 530 | if( pParent ){ |
| 531 | for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){ |
| 532 | pLoop->railInUse |= mask; |
| 533 | } |
| 534 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -901,11 +901,11 @@ | ||
| 901 | 901 | @ var n = drawBox(cls,p.bg,p.x,p.y); |
| 902 | 902 | @ n.id = "tln"+p.id; |
| 903 | 903 | @ n.onclick = clickOnNode; |
| 904 | 904 | @ n.style.zIndex = 10; |
| 905 | 905 | if( !omitDescenders ){ |
| 906 | - @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg); | |
| 906 | + @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: p.y-40},p.fg); | |
| 907 | 907 | @ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 908 | 908 | } |
| 909 | 909 | @ if( p.mo>=0 ){ |
| 910 | 910 | @ var x0 = p.x + node.w/2; |
| 911 | 911 | @ var x1 = p.mo*railPitch + node.w/2; |
| 912 | 912 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -901,11 +901,11 @@ | |
| 901 | @ var n = drawBox(cls,p.bg,p.x,p.y); |
| 902 | @ n.id = "tln"+p.id; |
| 903 | @ n.onclick = clickOnNode; |
| 904 | @ n.style.zIndex = 10; |
| 905 | if( !omitDescenders ){ |
| 906 | @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg); |
| 907 | @ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 908 | } |
| 909 | @ if( p.mo>=0 ){ |
| 910 | @ var x0 = p.x + node.w/2; |
| 911 | @ var x1 = p.mo*railPitch + node.w/2; |
| 912 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -901,11 +901,11 @@ | |
| 901 | @ var n = drawBox(cls,p.bg,p.x,p.y); |
| 902 | @ n.id = "tln"+p.id; |
| 903 | @ n.onclick = clickOnNode; |
| 904 | @ n.style.zIndex = 10; |
| 905 | if( !omitDescenders ){ |
| 906 | @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: p.y-40},p.fg); |
| 907 | @ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg); |
| 908 | } |
| 909 | @ if( p.mo>=0 ){ |
| 910 | @ var x0 = p.x + node.w/2; |
| 911 | @ var x1 = p.mo*railPitch + node.w/2; |
| 912 |