Fossil SCM

Fix a case in the graph renderer where a non-leaf node whose immediate child is not on screen did now show the arrow going straight up to the top of the page.

drh 2016-03-18 14:10 trunk
Commit da4a3b4ffb6447e16f308f6fd9be012f68af3dd1
1 file changed +15 -5
+15 -5
--- src/graph.c
+++ src/graph.c
@@ -326,10 +326,22 @@
326326
p->mxRail++;
327327
}
328328
}
329329
}
330330
331
+/*
332
+** Draw a riser from pRow to the top of the graph
333
+*/
334
+static void riser_to_top(GraphRow *pRow){
335
+ u64 mask = BIT(pRow->iRail);
336
+ pRow->aiRiser[pRow->iRail] = 0;
337
+ while( pRow ){
338
+ pRow->railInUse |= mask;
339
+ pRow = pRow->pPrev;
340
+ }
341
+}
342
+
331343
332344
/*
333345
** Compute the complete graph
334346
*/
335347
void graph_finish(GraphContext *p, int omitDescenders){
@@ -465,15 +477,11 @@
465477
if( pRow->iRail>=0 ){
466478
if( pRow->pChild==0 && !pRow->timeWarp ){
467479
if( omitDescenders || pRow->isLeaf ){
468480
/* no-op */
469481
}else{
470
- pRow->aiRiser[pRow->iRail] = 0;
471
- mask = BIT(pRow->iRail);
472
- for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){
473
- pLoop->railInUse |= mask;
474
- }
482
+ riser_to_top(pRow);
475483
}
476484
}
477485
continue;
478486
}
479487
if( pRow->isDup ){
@@ -511,10 +519,12 @@
511519
}
512520
mask = BIT(pRow->iRail);
513521
pRow->railInUse |= mask;
514522
if( pRow->pChild ){
515523
assignChildrenToRail(pRow);
524
+ }else if( !pRow->isLeaf ){
525
+ riser_to_top(pRow);
516526
}
517527
if( pParent ){
518528
for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
519529
pLoop->railInUse |= mask;
520530
}
521531
--- src/graph.c
+++ src/graph.c
@@ -326,10 +326,22 @@
326 p->mxRail++;
327 }
328 }
329 }
330
 
 
 
 
 
 
 
 
 
 
 
 
331
332 /*
333 ** Compute the complete graph
334 */
335 void graph_finish(GraphContext *p, int omitDescenders){
@@ -465,15 +477,11 @@
465 if( pRow->iRail>=0 ){
466 if( pRow->pChild==0 && !pRow->timeWarp ){
467 if( omitDescenders || pRow->isLeaf ){
468 /* no-op */
469 }else{
470 pRow->aiRiser[pRow->iRail] = 0;
471 mask = BIT(pRow->iRail);
472 for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){
473 pLoop->railInUse |= mask;
474 }
475 }
476 }
477 continue;
478 }
479 if( pRow->isDup ){
@@ -511,10 +519,12 @@
511 }
512 mask = BIT(pRow->iRail);
513 pRow->railInUse |= mask;
514 if( pRow->pChild ){
515 assignChildrenToRail(pRow);
 
 
516 }
517 if( pParent ){
518 for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
519 pLoop->railInUse |= mask;
520 }
521
--- src/graph.c
+++ src/graph.c
@@ -326,10 +326,22 @@
326 p->mxRail++;
327 }
328 }
329 }
330
331 /*
332 ** Draw a riser from pRow to the top of the graph
333 */
334 static void riser_to_top(GraphRow *pRow){
335 u64 mask = BIT(pRow->iRail);
336 pRow->aiRiser[pRow->iRail] = 0;
337 while( pRow ){
338 pRow->railInUse |= mask;
339 pRow = pRow->pPrev;
340 }
341 }
342
343
344 /*
345 ** Compute the complete graph
346 */
347 void graph_finish(GraphContext *p, int omitDescenders){
@@ -465,15 +477,11 @@
477 if( pRow->iRail>=0 ){
478 if( pRow->pChild==0 && !pRow->timeWarp ){
479 if( omitDescenders || pRow->isLeaf ){
480 /* no-op */
481 }else{
482 riser_to_top(pRow);
 
 
 
 
483 }
484 }
485 continue;
486 }
487 if( pRow->isDup ){
@@ -511,10 +519,12 @@
519 }
520 mask = BIT(pRow->iRail);
521 pRow->railInUse |= mask;
522 if( pRow->pChild ){
523 assignChildrenToRail(pRow);
524 }else if( !pRow->isLeaf ){
525 riser_to_top(pRow);
526 }
527 if( pParent ){
528 for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
529 pLoop->railInUse |= mask;
530 }
531

Keyboard Shortcuts

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