Fossil SCM
Allow the rail patch on graphs to go as low as 11 pixels. Adjust the offset of the merge risers as the rail pitch gets smaller so that merge arrows do not overlap the merge risers.
Commit
e81344f3bd663c143ed3e9857fb794bc596fdae0
Parent
e567a910de739d0…
2 files changed
+6
-3
+13
-2
+6
-3
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | u8 isDup; /* True if this is duplicate of a prior entry */ |
| 48 | 48 | u8 isLeaf; /* True if this is a leaf node */ |
| 49 | 49 | u8 timeWarp; /* Child is earlier in time */ |
| 50 | 50 | u8 bDescender; /* True if riser from bottom of graph to here. */ |
| 51 | 51 | i8 iRail; /* Which rail this check-in appears on. 0-based.*/ |
| 52 | - i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */ | |
| 52 | + i8 mergeOut; /* Merge out on rail mergeOut/4. -1 for none */ | |
| 53 | 53 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 54 | 54 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 55 | 55 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 56 | 56 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 57 | 57 | |
| @@ -584,9 +584,12 @@ | ||
| 584 | 584 | |
| 585 | 585 | /* |
| 586 | 586 | ** Find the maximum rail number. |
| 587 | 587 | */ |
| 588 | 588 | find_max_rail(p); |
| 589 | - p->iRailPitch = 18 - (p->mxRail/3); | |
| 590 | - if( p->iRailPitch<12 ) p->iRailPitch = 12; | |
| 589 | + p->iRailPitch = atoi(PD("railpitch","0")); | |
| 590 | + if( p->iRailPitch<=0 ){ | |
| 591 | + p->iRailPitch = 18 - (p->mxRail/3); | |
| 592 | + if( p->iRailPitch<11 ) p->iRailPitch = 11; | |
| 593 | + } | |
| 591 | 594 | p->nErr = 0; |
| 592 | 595 | } |
| 593 | 596 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | u8 isDup; /* True if this is duplicate of a prior entry */ |
| 48 | u8 isLeaf; /* True if this is a leaf node */ |
| 49 | u8 timeWarp; /* Child is earlier in time */ |
| 50 | u8 bDescender; /* True if riser from bottom of graph to here. */ |
| 51 | i8 iRail; /* Which rail this check-in appears on. 0-based.*/ |
| 52 | i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */ |
| 53 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 54 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 55 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 56 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 57 | |
| @@ -584,9 +584,12 @@ | |
| 584 | |
| 585 | /* |
| 586 | ** Find the maximum rail number. |
| 587 | */ |
| 588 | find_max_rail(p); |
| 589 | p->iRailPitch = 18 - (p->mxRail/3); |
| 590 | if( p->iRailPitch<12 ) p->iRailPitch = 12; |
| 591 | p->nErr = 0; |
| 592 | } |
| 593 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | u8 isDup; /* True if this is duplicate of a prior entry */ |
| 48 | u8 isLeaf; /* True if this is a leaf node */ |
| 49 | u8 timeWarp; /* Child is earlier in time */ |
| 50 | u8 bDescender; /* True if riser from bottom of graph to here. */ |
| 51 | i8 iRail; /* Which rail this check-in appears on. 0-based.*/ |
| 52 | i8 mergeOut; /* Merge out on rail mergeOut/4. -1 for none */ |
| 53 | u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */ |
| 54 | int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */ |
| 55 | int mergeUpto; /* Draw the mergeOut rail up to this level */ |
| 56 | u64 mergeDown; /* Draw merge lines up from bottom of graph */ |
| 57 | |
| @@ -584,9 +584,12 @@ | |
| 584 | |
| 585 | /* |
| 586 | ** Find the maximum rail number. |
| 587 | */ |
| 588 | find_max_rail(p); |
| 589 | p->iRailPitch = atoi(PD("railpitch","0")); |
| 590 | if( p->iRailPitch<=0 ){ |
| 591 | p->iRailPitch = 18 - (p->mxRail/3); |
| 592 | if( p->iRailPitch<11 ) p->iRailPitch = 11; |
| 593 | } |
| 594 | p->nErr = 0; |
| 595 | } |
| 596 |
+13
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -610,10 +610,15 @@ | ||
| 610 | 610 | ){ |
| 611 | 611 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 612 | 612 | GraphRow *pRow; |
| 613 | 613 | int i; |
| 614 | 614 | char cSep; |
| 615 | + int mergeOffset; | |
| 616 | + | |
| 617 | + /* Number of pixels that the thin merge lines are offset from the | |
| 618 | + ** the center of the think rail lines */ | |
| 619 | + mergeOffset = pGraph->iRailPitch>=14 ? 4 : pGraph->iRailPitch>=13 ? 3 : 0; | |
| 615 | 620 | |
| 616 | 621 | @ <script> |
| 617 | 622 | @ var railPitch=%d(pGraph->iRailPitch); |
| 618 | 623 | |
| 619 | 624 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -651,11 +656,17 @@ | ||
| 651 | 656 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 652 | 657 | int mo = pRow->mergeOut; |
| 653 | 658 | if( mo<0 ){ |
| 654 | 659 | mo = 0; |
| 655 | 660 | }else{ |
| 656 | - mo = (mo/4)*pGraph->iRailPitch - 3 + 4*(mo&3); | |
| 661 | + int x = (mo/4)*pGraph->iRailPitch; | |
| 662 | + switch( mo&3 ){ | |
| 663 | + case 0: x -= mergeOffset-2; break; | |
| 664 | + case 1: x += 1; break; | |
| 665 | + case 2: x += mergeOffset+1; break; | |
| 666 | + } | |
| 667 | + mo = x; | |
| 657 | 668 | } |
| 658 | 669 | cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,u:%d,f:%d,au:", |
| 659 | 670 | pRow->idx, /* id */ |
| 660 | 671 | pRow->zBgClr, /* bg */ |
| 661 | 672 | pRow->iRail, /* r */ |
| @@ -678,11 +689,11 @@ | ||
| 678 | 689 | cgi_printf("],mi:"); |
| 679 | 690 | /* mi */ |
| 680 | 691 | cSep = '['; |
| 681 | 692 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 682 | 693 | if( pRow->mergeIn[i] ){ |
| 683 | - int mi = i*pGraph->iRailPitch - 8 + 4*pRow->mergeIn[i]; | |
| 694 | + int mi = i*pGraph->iRailPitch - mergeOffset*(2 - pRow->mergeIn[i]); | |
| 684 | 695 | if( pRow->mergeDown & (1<<i) ) mi = -mi; |
| 685 | 696 | cgi_printf("%c%d", cSep, mi); |
| 686 | 697 | cSep = ','; |
| 687 | 698 | } |
| 688 | 699 | } |
| 689 | 700 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -610,10 +610,15 @@ | |
| 610 | ){ |
| 611 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 612 | GraphRow *pRow; |
| 613 | int i; |
| 614 | char cSep; |
| 615 | |
| 616 | @ <script> |
| 617 | @ var railPitch=%d(pGraph->iRailPitch); |
| 618 | |
| 619 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -651,11 +656,17 @@ | |
| 651 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 652 | int mo = pRow->mergeOut; |
| 653 | if( mo<0 ){ |
| 654 | mo = 0; |
| 655 | }else{ |
| 656 | mo = (mo/4)*pGraph->iRailPitch - 3 + 4*(mo&3); |
| 657 | } |
| 658 | cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,u:%d,f:%d,au:", |
| 659 | pRow->idx, /* id */ |
| 660 | pRow->zBgClr, /* bg */ |
| 661 | pRow->iRail, /* r */ |
| @@ -678,11 +689,11 @@ | |
| 678 | cgi_printf("],mi:"); |
| 679 | /* mi */ |
| 680 | cSep = '['; |
| 681 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 682 | if( pRow->mergeIn[i] ){ |
| 683 | int mi = i*pGraph->iRailPitch - 8 + 4*pRow->mergeIn[i]; |
| 684 | if( pRow->mergeDown & (1<<i) ) mi = -mi; |
| 685 | cgi_printf("%c%d", cSep, mi); |
| 686 | cSep = ','; |
| 687 | } |
| 688 | } |
| 689 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -610,10 +610,15 @@ | |
| 610 | ){ |
| 611 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 612 | GraphRow *pRow; |
| 613 | int i; |
| 614 | char cSep; |
| 615 | int mergeOffset; |
| 616 | |
| 617 | /* Number of pixels that the thin merge lines are offset from the |
| 618 | ** the center of the think rail lines */ |
| 619 | mergeOffset = pGraph->iRailPitch>=14 ? 4 : pGraph->iRailPitch>=13 ? 3 : 0; |
| 620 | |
| 621 | @ <script> |
| 622 | @ var railPitch=%d(pGraph->iRailPitch); |
| 623 | |
| 624 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -651,11 +656,17 @@ | |
| 656 | for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){ |
| 657 | int mo = pRow->mergeOut; |
| 658 | if( mo<0 ){ |
| 659 | mo = 0; |
| 660 | }else{ |
| 661 | int x = (mo/4)*pGraph->iRailPitch; |
| 662 | switch( mo&3 ){ |
| 663 | case 0: x -= mergeOffset-2; break; |
| 664 | case 1: x += 1; break; |
| 665 | case 2: x += mergeOffset+1; break; |
| 666 | } |
| 667 | mo = x; |
| 668 | } |
| 669 | cgi_printf("{id:%d,bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,u:%d,f:%d,au:", |
| 670 | pRow->idx, /* id */ |
| 671 | pRow->zBgClr, /* bg */ |
| 672 | pRow->iRail, /* r */ |
| @@ -678,11 +689,11 @@ | |
| 689 | cgi_printf("],mi:"); |
| 690 | /* mi */ |
| 691 | cSep = '['; |
| 692 | for(i=0; i<GR_MAX_RAIL; i++){ |
| 693 | if( pRow->mergeIn[i] ){ |
| 694 | int mi = i*pGraph->iRailPitch - mergeOffset*(2 - pRow->mergeIn[i]); |
| 695 | if( pRow->mergeDown & (1<<i) ) mi = -mi; |
| 696 | cgi_printf("%c%d", cSep, mi); |
| 697 | cSep = ','; |
| 698 | } |
| 699 | } |
| 700 |