Fossil SCM

Fix a bug in graph display for when a merge descender is on rail zero, for example the merge descender on the bottom node of [/timeline?b=e5b1c70e2a6e0434&n=22].

drh 2022-03-22 13:45 trunk
Commit 2bbd70da660dad900f960de245beff18c07b834cbd8c417e633e0b3b9d067267
2 files changed +4 -5 +4 -5
+4 -5
--- src/graph.js
+++ src/graph.js
@@ -53,14 +53,13 @@
5353
** is the rail on which the riser should run and the second integer
5454
** is the id of the node upto which the riser should run. If there
5555
** are no risers, this array does not exist.
5656
** mi: "merge-in". An array of integer rail positions from which
5757
** merge arrows should be drawn into this node. If the value is
58
-** negative, then the rail position is the absolute value of mi[]
59
-** and a thin merge-arrow descender is drawn to the bottom of
60
-** the screen. This array is omitted if there are no inbound
61
-** merges.
58
+** negative, then the rail position is -1-mi[] and a thin merge-arrow
59
+** descender is drawn to the bottom of the screen. This array is
60
+** omitted if there are no inbound merges.
6261
** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
6362
** omitted if there are no cherrypick merges.
6463
** h: The artifact hash of the object being graphed
6564
*/
6665
/* The amendCss() function does a one-time change to the CSS to account
@@ -512,11 +511,11 @@
512511
}
513512
if( p.hasOwnProperty('mi') ){
514513
for( var i=0; i<p.mi.length; i++ ){
515514
var rail = p.mi[i];
516515
if( rail<0 ){
517
- rail = -rail;
516
+ rail = -1-rail;
518517
mergeLines[rail] = -mLine.w/2;
519518
var x = rail*railPitch + (node.w-mLine.w)/2;
520519
var y = miLineY(p);
521520
drawMergeLine(x,y,null,mergeBtm[rail]);
522521
mergeBtm[rail] = y;
523522
--- src/graph.js
+++ src/graph.js
@@ -53,14 +53,13 @@
53 ** is the rail on which the riser should run and the second integer
54 ** is the id of the node upto which the riser should run. If there
55 ** are no risers, this array does not exist.
56 ** mi: "merge-in". An array of integer rail positions from which
57 ** merge arrows should be drawn into this node. If the value is
58 ** negative, then the rail position is the absolute value of mi[]
59 ** and a thin merge-arrow descender is drawn to the bottom of
60 ** the screen. This array is omitted if there are no inbound
61 ** merges.
62 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
63 ** omitted if there are no cherrypick merges.
64 ** h: The artifact hash of the object being graphed
65 */
66 /* The amendCss() function does a one-time change to the CSS to account
@@ -512,11 +511,11 @@
512 }
513 if( p.hasOwnProperty('mi') ){
514 for( var i=0; i<p.mi.length; i++ ){
515 var rail = p.mi[i];
516 if( rail<0 ){
517 rail = -rail;
518 mergeLines[rail] = -mLine.w/2;
519 var x = rail*railPitch + (node.w-mLine.w)/2;
520 var y = miLineY(p);
521 drawMergeLine(x,y,null,mergeBtm[rail]);
522 mergeBtm[rail] = y;
523
--- src/graph.js
+++ src/graph.js
@@ -53,14 +53,13 @@
53 ** is the rail on which the riser should run and the second integer
54 ** is the id of the node upto which the riser should run. If there
55 ** are no risers, this array does not exist.
56 ** mi: "merge-in". An array of integer rail positions from which
57 ** merge arrows should be drawn into this node. If the value is
58 ** negative, then the rail position is -1-mi[] and a thin merge-arrow
59 ** descender is drawn to the bottom of the screen. This array is
60 ** omitted if there are no inbound merges.
 
61 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
62 ** omitted if there are no cherrypick merges.
63 ** h: The artifact hash of the object being graphed
64 */
65 /* The amendCss() function does a one-time change to the CSS to account
@@ -512,11 +511,11 @@
511 }
512 if( p.hasOwnProperty('mi') ){
513 for( var i=0; i<p.mi.length; i++ ){
514 var rail = p.mi[i];
515 if( rail<0 ){
516 rail = -1-rail;
517 mergeLines[rail] = -mLine.w/2;
518 var x = rail*railPitch + (node.w-mLine.w)/2;
519 var y = miLineY(p);
520 drawMergeLine(x,y,null,mergeBtm[rail]);
521 mergeBtm[rail] = y;
522
+4 -5
--- src/timeline.c
+++ src/timeline.c
@@ -925,14 +925,13 @@
925925
** is the rail on which the riser should run and the second integer
926926
** is the id of the node upto which the riser should run. If there
927927
** are no risers, this array does not exist.
928928
** mi: "merge-in". An array of integer rail positions from which
929929
** merge arrows should be drawn into this node. If the value is
930
- ** negative, then the rail position is the absolute value of mi[]
931
- ** and a thin merge-arrow descender is drawn to the bottom of
932
- ** the screen. This array is omitted if there are no inbound
933
- ** merges.
930
+ ** negative, then the rail position is -1-mi[] and a thin merge-arrow
931
+ ** descender is drawn to the bottom of the screen. This array is
932
+ ** omitted if there are no inbound merges.
934933
** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
935934
** omitted if there are no cherrypick merges.
936935
** h: The artifact hash of the object being graphed
937936
* br: The branch to which the artifact belongs
938937
*/
@@ -981,11 +980,11 @@
981980
}
982981
/* mi */
983982
for(i=k=0; i<GR_MAX_RAIL; i++){
984983
if( pRow->mergeIn[i]==1 ){
985984
int mi = aiMap[i];
986
- if( (pRow->mergeDown >> i) & 1 ) mi = -mi;
985
+ if( (pRow->mergeDown >> i) & 1 ) mi = -1-mi;
987986
if( k==0 ){
988987
cgi_printf("\"mi\":");
989988
cSep = '[';
990989
}
991990
k++;
992991
--- src/timeline.c
+++ src/timeline.c
@@ -925,14 +925,13 @@
925 ** is the rail on which the riser should run and the second integer
926 ** is the id of the node upto which the riser should run. If there
927 ** are no risers, this array does not exist.
928 ** mi: "merge-in". An array of integer rail positions from which
929 ** merge arrows should be drawn into this node. If the value is
930 ** negative, then the rail position is the absolute value of mi[]
931 ** and a thin merge-arrow descender is drawn to the bottom of
932 ** the screen. This array is omitted if there are no inbound
933 ** merges.
934 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
935 ** omitted if there are no cherrypick merges.
936 ** h: The artifact hash of the object being graphed
937 * br: The branch to which the artifact belongs
938 */
@@ -981,11 +980,11 @@
981 }
982 /* mi */
983 for(i=k=0; i<GR_MAX_RAIL; i++){
984 if( pRow->mergeIn[i]==1 ){
985 int mi = aiMap[i];
986 if( (pRow->mergeDown >> i) & 1 ) mi = -mi;
987 if( k==0 ){
988 cgi_printf("\"mi\":");
989 cSep = '[';
990 }
991 k++;
992
--- src/timeline.c
+++ src/timeline.c
@@ -925,14 +925,13 @@
925 ** is the rail on which the riser should run and the second integer
926 ** is the id of the node upto which the riser should run. If there
927 ** are no risers, this array does not exist.
928 ** mi: "merge-in". An array of integer rail positions from which
929 ** merge arrows should be drawn into this node. If the value is
930 ** negative, then the rail position is -1-mi[] and a thin merge-arrow
931 ** descender is drawn to the bottom of the screen. This array is
932 ** omitted if there are no inbound merges.
 
933 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
934 ** omitted if there are no cherrypick merges.
935 ** h: The artifact hash of the object being graphed
936 * br: The branch to which the artifact belongs
937 */
@@ -981,11 +980,11 @@
980 }
981 /* mi */
982 for(i=k=0; i<GR_MAX_RAIL; i++){
983 if( pRow->mergeIn[i]==1 ){
984 int mi = aiMap[i];
985 if( (pRow->mergeDown >> i) & 1 ) mi = -1-mi;
986 if( k==0 ){
987 cgi_printf("\"mi\":");
988 cSep = '[';
989 }
990 k++;
991

Keyboard Shortcuts

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