Fossil SCM
Fix a case in the graph renderer where a non-leaf node whose immediate child is not on screen did now show the arrow going straight up to the top of the page.
Commit
da4a3b4ffb6447e16f308f6fd9be012f68af3dd1
Parent
f73411025e8ebec…
1 file changed
+15
-5
+15
-5
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -326,10 +326,22 @@ | ||
| 326 | 326 | p->mxRail++; |
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 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 | + | |
| 331 | 343 | |
| 332 | 344 | /* |
| 333 | 345 | ** Compute the complete graph |
| 334 | 346 | */ |
| 335 | 347 | void graph_finish(GraphContext *p, int omitDescenders){ |
| @@ -465,15 +477,11 @@ | ||
| 465 | 477 | if( pRow->iRail>=0 ){ |
| 466 | 478 | if( pRow->pChild==0 && !pRow->timeWarp ){ |
| 467 | 479 | if( omitDescenders || pRow->isLeaf ){ |
| 468 | 480 | /* no-op */ |
| 469 | 481 | }else{ |
| 470 | - pRow->aiRiser[pRow->iRail] = 0; | |
| 471 | - mask = BIT(pRow->iRail); | |
| 472 | - for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){ | |
| 473 | - pLoop->railInUse |= mask; | |
| 474 | - } | |
| 482 | + riser_to_top(pRow); | |
| 475 | 483 | } |
| 476 | 484 | } |
| 477 | 485 | continue; |
| 478 | 486 | } |
| 479 | 487 | if( pRow->isDup ){ |
| @@ -511,10 +519,12 @@ | ||
| 511 | 519 | } |
| 512 | 520 | mask = BIT(pRow->iRail); |
| 513 | 521 | pRow->railInUse |= mask; |
| 514 | 522 | if( pRow->pChild ){ |
| 515 | 523 | assignChildrenToRail(pRow); |
| 524 | + }else if( !pRow->isLeaf ){ | |
| 525 | + riser_to_top(pRow); | |
| 516 | 526 | } |
| 517 | 527 | if( pParent ){ |
| 518 | 528 | for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){ |
| 519 | 529 | pLoop->railInUse |= mask; |
| 520 | 530 | } |
| 521 | 531 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -326,10 +326,22 @@ | |
| 326 | p->mxRail++; |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | |
| 332 | /* |
| 333 | ** Compute the complete graph |
| 334 | */ |
| 335 | void graph_finish(GraphContext *p, int omitDescenders){ |
| @@ -465,15 +477,11 @@ | |
| 465 | if( pRow->iRail>=0 ){ |
| 466 | if( pRow->pChild==0 && !pRow->timeWarp ){ |
| 467 | if( omitDescenders || pRow->isLeaf ){ |
| 468 | /* no-op */ |
| 469 | }else{ |
| 470 | pRow->aiRiser[pRow->iRail] = 0; |
| 471 | mask = BIT(pRow->iRail); |
| 472 | for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){ |
| 473 | pLoop->railInUse |= mask; |
| 474 | } |
| 475 | } |
| 476 | } |
| 477 | continue; |
| 478 | } |
| 479 | if( pRow->isDup ){ |
| @@ -511,10 +519,12 @@ | |
| 511 | } |
| 512 | mask = BIT(pRow->iRail); |
| 513 | pRow->railInUse |= mask; |
| 514 | if( pRow->pChild ){ |
| 515 | assignChildrenToRail(pRow); |
| 516 | } |
| 517 | if( pParent ){ |
| 518 | for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){ |
| 519 | pLoop->railInUse |= mask; |
| 520 | } |
| 521 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -326,10 +326,22 @@ | |
| 326 | p->mxRail++; |
| 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 | |
| 343 | |
| 344 | /* |
| 345 | ** Compute the complete graph |
| 346 | */ |
| 347 | void graph_finish(GraphContext *p, int omitDescenders){ |
| @@ -465,15 +477,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 ){ |
| @@ -511,10 +519,12 @@ | |
| 519 | } |
| 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 |