Fossil SCM
Further improvement to rail selection in the /timeline graph layout algorithm: Move merge lines that go into the branch rail that is on the left, over toward the left when using the r=BRANCH query parameter.
Commit
b71363e5c51f1192b06720bb159aa4f42eaf8233ba759ec6cd2c49bfff855d0e
Parent
19b7f15ba48a149…
1 file changed
+9
-10
+9
-10
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -979,13 +979,14 @@ | ||
| 979 | 979 | if( nTimewarp==0 ){ |
| 980 | 980 | /* Priority bits: |
| 981 | 981 | ** |
| 982 | 982 | ** 0x04 The preferred branch |
| 983 | 983 | ** |
| 984 | - ** 0x02 A merge rail - a rail that contains merge lines | |
| 985 | - ** ^^^^----- Omit this as of 2024-04-23, as it actually seems to | |
| 986 | - ** detract from appearance, not help. | |
| 984 | + ** 0x02 A merge rail - a rail that contains merge lines into | |
| 985 | + ** the preferred branch. Only applies if a preferred branch | |
| 986 | + ** is defined. This improves the display of r=BRANCH | |
| 987 | + ** options to /timeline. | |
| 987 | 988 | ** |
| 988 | 989 | ** 0x01 A rail that merges with the preferred branch |
| 989 | 990 | */ |
| 990 | 991 | u8 aPriority[GR_MAX_RAIL]; |
| 991 | 992 | memset(aPriority, 0, p->mxRail+1); |
| @@ -997,10 +998,15 @@ | ||
| 997 | 998 | for(i=0; i<=p->mxRail; i++){ |
| 998 | 999 | if( pRow->mergeIn[i] ) aPriority[i] |= 1; |
| 999 | 1000 | } |
| 1000 | 1001 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1001 | 1002 | } |
| 1003 | + } | |
| 1004 | + for(i=0; i<=p->mxRail; i++){ | |
| 1005 | + if( p->mergeRail & BIT(i) ){ | |
| 1006 | + aPriority[i] |= 2; | |
| 1007 | + } | |
| 1002 | 1008 | } |
| 1003 | 1009 | }else{ |
| 1004 | 1010 | j = 1; |
| 1005 | 1011 | aPriority[0] = 4; |
| 1006 | 1012 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| @@ -1010,17 +1016,10 @@ | ||
| 1010 | 1016 | } |
| 1011 | 1017 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1012 | 1018 | } |
| 1013 | 1019 | } |
| 1014 | 1020 | } |
| 1015 | -#if 0 /* Omit the 0x02 priority boost due to merge rails */ | |
| 1016 | - for(i=0; i<=p->mxRail; i++){ | |
| 1017 | - if( p->mergeRail & BIT(i) ){ | |
| 1018 | - aPriority[i] |= 2; | |
| 1019 | - } | |
| 1020 | - } | |
| 1021 | -#endif | |
| 1022 | 1021 | |
| 1023 | 1022 | #if 0 |
| 1024 | 1023 | fprintf(stderr,"mergeRail: 0x%llx\n", p->mergeRail); |
| 1025 | 1024 | fprintf(stderr,"Priority:"); |
| 1026 | 1025 | for(i=0; i<=p->mxRail; i++) fprintf(stderr," %d", aPriority[i]); |
| 1027 | 1026 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -979,13 +979,14 @@ | |
| 979 | if( nTimewarp==0 ){ |
| 980 | /* Priority bits: |
| 981 | ** |
| 982 | ** 0x04 The preferred branch |
| 983 | ** |
| 984 | ** 0x02 A merge rail - a rail that contains merge lines |
| 985 | ** ^^^^----- Omit this as of 2024-04-23, as it actually seems to |
| 986 | ** detract from appearance, not help. |
| 987 | ** |
| 988 | ** 0x01 A rail that merges with the preferred branch |
| 989 | */ |
| 990 | u8 aPriority[GR_MAX_RAIL]; |
| 991 | memset(aPriority, 0, p->mxRail+1); |
| @@ -997,10 +998,15 @@ | |
| 997 | for(i=0; i<=p->mxRail; i++){ |
| 998 | if( pRow->mergeIn[i] ) aPriority[i] |= 1; |
| 999 | } |
| 1000 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1001 | } |
| 1002 | } |
| 1003 | }else{ |
| 1004 | j = 1; |
| 1005 | aPriority[0] = 4; |
| 1006 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| @@ -1010,17 +1016,10 @@ | |
| 1010 | } |
| 1011 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1012 | } |
| 1013 | } |
| 1014 | } |
| 1015 | #if 0 /* Omit the 0x02 priority boost due to merge rails */ |
| 1016 | for(i=0; i<=p->mxRail; i++){ |
| 1017 | if( p->mergeRail & BIT(i) ){ |
| 1018 | aPriority[i] |= 2; |
| 1019 | } |
| 1020 | } |
| 1021 | #endif |
| 1022 | |
| 1023 | #if 0 |
| 1024 | fprintf(stderr,"mergeRail: 0x%llx\n", p->mergeRail); |
| 1025 | fprintf(stderr,"Priority:"); |
| 1026 | for(i=0; i<=p->mxRail; i++) fprintf(stderr," %d", aPriority[i]); |
| 1027 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -979,13 +979,14 @@ | |
| 979 | if( nTimewarp==0 ){ |
| 980 | /* Priority bits: |
| 981 | ** |
| 982 | ** 0x04 The preferred branch |
| 983 | ** |
| 984 | ** 0x02 A merge rail - a rail that contains merge lines into |
| 985 | ** the preferred branch. Only applies if a preferred branch |
| 986 | ** is defined. This improves the display of r=BRANCH |
| 987 | ** options to /timeline. |
| 988 | ** |
| 989 | ** 0x01 A rail that merges with the preferred branch |
| 990 | */ |
| 991 | u8 aPriority[GR_MAX_RAIL]; |
| 992 | memset(aPriority, 0, p->mxRail+1); |
| @@ -997,10 +998,15 @@ | |
| 998 | for(i=0; i<=p->mxRail; i++){ |
| 999 | if( pRow->mergeIn[i] ) aPriority[i] |= 1; |
| 1000 | } |
| 1001 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1002 | } |
| 1003 | } |
| 1004 | for(i=0; i<=p->mxRail; i++){ |
| 1005 | if( p->mergeRail & BIT(i) ){ |
| 1006 | aPriority[i] |= 2; |
| 1007 | } |
| 1008 | } |
| 1009 | }else{ |
| 1010 | j = 1; |
| 1011 | aPriority[0] = 4; |
| 1012 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| @@ -1010,17 +1016,10 @@ | |
| 1016 | } |
| 1017 | if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1; |
| 1018 | } |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | #if 0 |
| 1023 | fprintf(stderr,"mergeRail: 0x%llx\n", p->mergeRail); |
| 1024 | fprintf(stderr,"Priority:"); |
| 1025 | for(i=0; i<=p->mxRail; i++) fprintf(stderr," %d", aPriority[i]); |
| 1026 |