Fossil SCM
In the graph layout, make sure that the idxTop value is properly relayed across gaps.
Commit
e0186fdb5ef46795c03a235d12103a468f7f5548897b45af95f5ab3dd70e20c2
Parent
78d812e24d983db…
1 file changed
+14
-11
+14
-11
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -515,16 +515,13 @@ | ||
| 515 | 515 | if( pRow->nParent<=0 ) continue; /* Root node */ |
| 516 | 516 | pParent = hashFind(p, pRow->aParent[0]); |
| 517 | 517 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 518 | 518 | if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */ |
| 519 | 519 | if( pParent->idx <= pRow->idx ){ |
| 520 | - pParent->timeWarp = 1; | |
| 521 | - continue; /* Time-warp */ | |
| 522 | - } | |
| 523 | - if( pRow->idxTop < pParent->idxTop ){ | |
| 520 | + pParent->timeWarp = 1; | |
| 521 | + }else if( pRow->idx < pParent->idx ){ | |
| 524 | 522 | pParent->pChild = pRow; |
| 525 | - pParent->idxTop = pRow->idxTop; | |
| 526 | 523 | } |
| 527 | 524 | } |
| 528 | 525 | |
| 529 | 526 | if( tmFlags & TIMELINE_FILLGAPS ){ |
| 530 | 527 | /* If a node has no pChild but there is a node higher up in the graph |
| @@ -538,34 +535,40 @@ | ||
| 538 | 535 | if( pLoop->nParent>0 |
| 539 | 536 | && pLoop->zBranch==pRow->zBranch |
| 540 | 537 | && hashFind(p,pLoop->aParent[0])==0 |
| 541 | 538 | ){ |
| 542 | 539 | pRow->pChild = pLoop; |
| 543 | - pRow->idxTop = pLoop->idxTop; | |
| 544 | 540 | pRow->isStepParent = 1; |
| 545 | 541 | pLoop->aParent[0] = pRow->rid; |
| 546 | 542 | break; |
| 547 | 543 | } |
| 548 | 544 | } |
| 549 | 545 | } |
| 550 | 546 | } |
| 547 | + | |
| 548 | + /* Set the idxTop values for all entries. The idxTop value is the | |
| 549 | + ** "idx" value for the top entry in its stack of children. | |
| 550 | + */ | |
| 551 | + for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ | |
| 552 | + GraphRow *pChild = pRow->pChild; | |
| 553 | + if( pChild && pRow->idxTop>pChild->idxTop ){ | |
| 554 | + pRow->idxTop = pChild->idxTop; | |
| 555 | + } | |
| 556 | + } | |
| 551 | 557 | |
| 552 | 558 | /* Identify rows where the primary parent is off screen. Assign |
| 553 | 559 | ** each to a rail and draw descenders downward. |
| 554 | 560 | ** |
| 555 | 561 | ** Strive to put the "trunk" branch on far left. |
| 556 | 562 | */ |
| 557 | 563 | zTrunk = persistBranchName(p, "trunk"); |
| 558 | 564 | for(i=0; i<2; i++){ |
| 559 | 565 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 566 | + if( i==0 && pRow->zBranch!=zTrunk ) continue; | |
| 567 | + if( pRow->iRail>=0 ) continue; | |
| 560 | 568 | if( pRow->isDup ) continue; |
| 561 | 569 | if( pRow->nParent<0 ) continue; |
| 562 | - if( i==0 ){ | |
| 563 | - if( pRow->zBranch!=zTrunk ) continue; | |
| 564 | - }else { | |
| 565 | - if( pRow->iRail>=0 ) continue; | |
| 566 | - } | |
| 567 | 570 | if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ |
| 568 | 571 | pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx+RISER_MARGIN, 0); |
| 569 | 572 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 570 | 573 | mask = BIT(pRow->iRail); |
| 571 | 574 | if( !omitDescenders ){ |
| 572 | 575 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -515,16 +515,13 @@ | |
| 515 | if( pRow->nParent<=0 ) continue; /* Root node */ |
| 516 | pParent = hashFind(p, pRow->aParent[0]); |
| 517 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 518 | if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */ |
| 519 | if( pParent->idx <= pRow->idx ){ |
| 520 | pParent->timeWarp = 1; |
| 521 | continue; /* Time-warp */ |
| 522 | } |
| 523 | if( pRow->idxTop < pParent->idxTop ){ |
| 524 | pParent->pChild = pRow; |
| 525 | pParent->idxTop = pRow->idxTop; |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | if( tmFlags & TIMELINE_FILLGAPS ){ |
| 530 | /* If a node has no pChild but there is a node higher up in the graph |
| @@ -538,34 +535,40 @@ | |
| 538 | if( pLoop->nParent>0 |
| 539 | && pLoop->zBranch==pRow->zBranch |
| 540 | && hashFind(p,pLoop->aParent[0])==0 |
| 541 | ){ |
| 542 | pRow->pChild = pLoop; |
| 543 | pRow->idxTop = pLoop->idxTop; |
| 544 | pRow->isStepParent = 1; |
| 545 | pLoop->aParent[0] = pRow->rid; |
| 546 | break; |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | /* Identify rows where the primary parent is off screen. Assign |
| 553 | ** each to a rail and draw descenders downward. |
| 554 | ** |
| 555 | ** Strive to put the "trunk" branch on far left. |
| 556 | */ |
| 557 | zTrunk = persistBranchName(p, "trunk"); |
| 558 | for(i=0; i<2; i++){ |
| 559 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 560 | if( pRow->isDup ) continue; |
| 561 | if( pRow->nParent<0 ) continue; |
| 562 | if( i==0 ){ |
| 563 | if( pRow->zBranch!=zTrunk ) continue; |
| 564 | }else { |
| 565 | if( pRow->iRail>=0 ) continue; |
| 566 | } |
| 567 | if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ |
| 568 | pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx+RISER_MARGIN, 0); |
| 569 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 570 | mask = BIT(pRow->iRail); |
| 571 | if( !omitDescenders ){ |
| 572 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -515,16 +515,13 @@ | |
| 515 | if( pRow->nParent<=0 ) continue; /* Root node */ |
| 516 | pParent = hashFind(p, pRow->aParent[0]); |
| 517 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 518 | if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */ |
| 519 | if( pParent->idx <= pRow->idx ){ |
| 520 | pParent->timeWarp = 1; |
| 521 | }else if( pRow->idx < pParent->idx ){ |
| 522 | pParent->pChild = pRow; |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | if( tmFlags & TIMELINE_FILLGAPS ){ |
| 527 | /* If a node has no pChild but there is a node higher up in the graph |
| @@ -538,34 +535,40 @@ | |
| 535 | if( pLoop->nParent>0 |
| 536 | && pLoop->zBranch==pRow->zBranch |
| 537 | && hashFind(p,pLoop->aParent[0])==0 |
| 538 | ){ |
| 539 | pRow->pChild = pLoop; |
| 540 | pRow->isStepParent = 1; |
| 541 | pLoop->aParent[0] = pRow->rid; |
| 542 | break; |
| 543 | } |
| 544 | } |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | /* Set the idxTop values for all entries. The idxTop value is the |
| 549 | ** "idx" value for the top entry in its stack of children. |
| 550 | */ |
| 551 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 552 | GraphRow *pChild = pRow->pChild; |
| 553 | if( pChild && pRow->idxTop>pChild->idxTop ){ |
| 554 | pRow->idxTop = pChild->idxTop; |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | /* Identify rows where the primary parent is off screen. Assign |
| 559 | ** each to a rail and draw descenders downward. |
| 560 | ** |
| 561 | ** Strive to put the "trunk" branch on far left. |
| 562 | */ |
| 563 | zTrunk = persistBranchName(p, "trunk"); |
| 564 | for(i=0; i<2; i++){ |
| 565 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 566 | if( i==0 && pRow->zBranch!=zTrunk ) continue; |
| 567 | if( pRow->iRail>=0 ) continue; |
| 568 | if( pRow->isDup ) continue; |
| 569 | if( pRow->nParent<0 ) continue; |
| 570 | if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ |
| 571 | pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx+RISER_MARGIN, 0); |
| 572 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 573 | mask = BIT(pRow->iRail); |
| 574 | if( !omitDescenders ){ |
| 575 |