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.

drh 2024-04-23 18:22 trunk
Commit b71363e5c51f1192b06720bb159aa4f42eaf8233ba759ec6cd2c49bfff855d0e
1 file changed +9 -10
+9 -10
--- src/graph.c
+++ src/graph.c
@@ -979,13 +979,14 @@
979979
if( nTimewarp==0 ){
980980
/* Priority bits:
981981
**
982982
** 0x04 The preferred branch
983983
**
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.
987988
**
988989
** 0x01 A rail that merges with the preferred branch
989990
*/
990991
u8 aPriority[GR_MAX_RAIL];
991992
memset(aPriority, 0, p->mxRail+1);
@@ -997,10 +998,15 @@
997998
for(i=0; i<=p->mxRail; i++){
998999
if( pRow->mergeIn[i] ) aPriority[i] |= 1;
9991000
}
10001001
if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1;
10011002
}
1003
+ }
1004
+ for(i=0; i<=p->mxRail; i++){
1005
+ if( p->mergeRail & BIT(i) ){
1006
+ aPriority[i] |= 2;
1007
+ }
10021008
}
10031009
}else{
10041010
j = 1;
10051011
aPriority[0] = 4;
10061012
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
@@ -1010,17 +1016,10 @@
10101016
}
10111017
if( pRow->mergeOut>=0 ) aPriority[pRow->mergeOut] |= 1;
10121018
}
10131019
}
10141020
}
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
10221021
10231022
#if 0
10241023
fprintf(stderr,"mergeRail: 0x%llx\n", p->mergeRail);
10251024
fprintf(stderr,"Priority:");
10261025
for(i=0; i<=p->mxRail; i++) fprintf(stderr," %d", aPriority[i]);
10271026
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button