Fossil SCM

Draw the upward riser arrow just a short ways, not to the top of screen, for nodes whose next child is off-screen.

drh 2016-03-18 14:35 UTC trunk
Commit 70ba2951f2802a2f76691bb9f04ffddc14b95076
2 files changed +8 -5 +1 -1
+8 -5
--- src/graph.c
+++ src/graph.c
@@ -327,16 +327,19 @@
327327
}
328328
}
329329
}
330330
331331
/*
332
-** Draw a riser from pRow to the top of the graph
332
+** pRow has direct children, but they are all off-screen and not
333
+** shown on the current graph. Therefore, draw an arrow up from
334
+** pRow but terminate it in empty space.
333335
*/
334
-static void riser_to_top(GraphRow *pRow){
336
+static void riserToOffScreenChild(GraphRow *pRow){
335337
u64 mask = BIT(pRow->iRail);
336338
pRow->aiRiser[pRow->iRail] = 0;
337
- while( pRow ){
339
+ int n = 0;
340
+ while( pRow && (n++)<3 ){
338341
pRow->railInUse |= mask;
339342
pRow = pRow->pPrev;
340343
}
341344
}
342345
@@ -477,11 +480,11 @@
477480
if( pRow->iRail>=0 ){
478481
if( pRow->pChild==0 && !pRow->timeWarp ){
479482
if( omitDescenders || pRow->isLeaf ){
480483
/* no-op */
481484
}else{
482
- riser_to_top(pRow);
485
+ riserToOffScreenChild(pRow);
483486
}
484487
}
485488
continue;
486489
}
487490
if( pRow->isDup ){
@@ -520,11 +523,11 @@
520523
mask = BIT(pRow->iRail);
521524
pRow->railInUse |= mask;
522525
if( pRow->pChild ){
523526
assignChildrenToRail(pRow);
524527
}else if( !pRow->isLeaf ){
525
- riser_to_top(pRow);
528
+ riserToOffScreenChild(pRow);
526529
}
527530
if( pParent ){
528531
for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
529532
pLoop->railInUse |= mask;
530533
}
531534
--- src/graph.c
+++ src/graph.c
@@ -327,16 +327,19 @@
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
@@ -477,11 +480,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 ){
@@ -520,11 +523,11 @@
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
--- src/graph.c
+++ src/graph.c
@@ -327,16 +327,19 @@
327 }
328 }
329 }
330
331 /*
332 ** pRow has direct children, but they are all off-screen and not
333 ** shown on the current graph. Therefore, draw an arrow up from
334 ** pRow but terminate it in empty space.
335 */
336 static void riserToOffScreenChild(GraphRow *pRow){
337 u64 mask = BIT(pRow->iRail);
338 pRow->aiRiser[pRow->iRail] = 0;
339 int n = 0;
340 while( pRow && (n++)<3 ){
341 pRow->railInUse |= mask;
342 pRow = pRow->pPrev;
343 }
344 }
345
@@ -477,11 +480,11 @@
480 if( pRow->iRail>=0 ){
481 if( pRow->pChild==0 && !pRow->timeWarp ){
482 if( omitDescenders || pRow->isLeaf ){
483 /* no-op */
484 }else{
485 riserToOffScreenChild(pRow);
486 }
487 }
488 continue;
489 }
490 if( pRow->isDup ){
@@ -520,11 +523,11 @@
523 mask = BIT(pRow->iRail);
524 pRow->railInUse |= mask;
525 if( pRow->pChild ){
526 assignChildrenToRail(pRow);
527 }else if( !pRow->isLeaf ){
528 riserToOffScreenChild(pRow);
529 }
530 if( pParent ){
531 for(pLoop=pParent->pPrev; pLoop && pLoop!=pRow; pLoop=pLoop->pPrev){
532 pLoop->railInUse |= mask;
533 }
534
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -901,11 +901,11 @@
901901
@ var n = drawBox(cls,p.bg,p.x,p.y);
902902
@ n.id = "tln"+p.id;
903903
@ n.onclick = clickOnNode;
904904
@ n.style.zIndex = 10;
905905
if( !omitDescenders ){
906
- @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg);
906
+ @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: p.y-40},p.fg);
907907
@ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg);
908908
}
909909
@ if( p.mo>=0 ){
910910
@ var x0 = p.x + node.w/2;
911911
@ var x1 = p.mo*railPitch + node.w/2;
912912
--- src/timeline.c
+++ src/timeline.c
@@ -901,11 +901,11 @@
901 @ var n = drawBox(cls,p.bg,p.x,p.y);
902 @ n.id = "tln"+p.id;
903 @ n.onclick = clickOnNode;
904 @ n.style.zIndex = 10;
905 if( !omitDescenders ){
906 @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: -node.h},p.fg);
907 @ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg);
908 }
909 @ if( p.mo>=0 ){
910 @ var x0 = p.x + node.w/2;
911 @ var x1 = p.mo*railPitch + node.w/2;
912
--- src/timeline.c
+++ src/timeline.c
@@ -901,11 +901,11 @@
901 @ var n = drawBox(cls,p.bg,p.x,p.y);
902 @ n.id = "tln"+p.id;
903 @ n.onclick = clickOnNode;
904 @ n.style.zIndex = 10;
905 if( !omitDescenders ){
906 @ if( p.u==0 ) drawUpArrow(p,{x: p.x, y: p.y-40},p.fg);
907 @ if( p.d ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg);
908 }
909 @ if( p.mo>=0 ){
910 @ var x0 = p.x + node.w/2;
911 @ var x1 = p.mo*railPitch + node.w/2;
912

Keyboard Shortcuts

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