Fossil SCM

Improved layout for merge arrows.

drh 2019-05-21 18:35 trunk
Commit e008e051cd5076f4c480da7a0c2985a6d7ee72019987f13703a412ed26c8f7ee
1 file changed +6 -2
+6 -2
--- src/graph.c
+++ src/graph.c
@@ -73,10 +73,11 @@
7373
u8 isLeaf; /* True if this is a leaf node */
7474
u8 isStepParent; /* pChild is actually a step-child */
7575
u8 hasNormalOutMerge; /* Is parent of at laest 1 non-cherrypick merge */
7676
u8 timeWarp; /* Child is earlier in time */
7777
u8 bDescender; /* True if riser from bottom of graph to here. */
78
+ u8 selfUp; /* Space above this node but belonging */
7879
i8 iRail; /* Which rail this check-in appears on. 0-based.*/
7980
i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
8081
u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
8182
int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
8283
int mergeUpto; /* Draw the mergeOut rail up to this level */
@@ -319,11 +320,13 @@
319320
}
320321
/* Mask of additional rows for the riser to infinity */
321322
if( !pPrior->isLeaf && (tmFlags & TIMELINE_DISJOINT)==0 ){
322323
int n = RISER_MARGIN;
323324
GraphRow *p;
325
+ pPrior->selfUp = 0;
324326
for(p=pPrior; p && (n--)>0; p=p->pPrev){
327
+ pPrior->selfUp++;
325328
p->railInUse |= mask;
326329
}
327330
}
328331
}
329332
@@ -345,16 +348,17 @@
345348
if( u>0 && u<pChild->idx ){
346349
/* The thick arrow up to the next primary child of pDesc goes
347350
** further up than the thin merge arrow riser, so draw them both
348351
** on the same rail. */
349352
pParent->mergeOut = pParent->iRail;
353
+ }else if( pParent->idx - pChild->idx < pParent->selfUp ){
354
+ pParent->mergeOut = pParent->iRail;
350355
}else{
351356
/* The thin merge arrow riser is taller than the thick primary
352357
** child riser, so use separate rails. */
353358
int iTarget = pParent->iRail;
354
- int iBtm = pParent->idx - (u==0 ? RISER_MARGIN : 1);
355
- pParent->mergeOut = findFreeRail(p, pChild->idx, iBtm, iTarget);
359
+ pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1, iTarget);
356360
mask = BIT(pParent->mergeOut);
357361
for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
358362
pLoop=pLoop->pNext){
359363
pLoop->railInUse |= mask;
360364
}
361365
--- src/graph.c
+++ src/graph.c
@@ -73,10 +73,11 @@
73 u8 isLeaf; /* True if this is a leaf node */
74 u8 isStepParent; /* pChild is actually a step-child */
75 u8 hasNormalOutMerge; /* Is parent of at laest 1 non-cherrypick merge */
76 u8 timeWarp; /* Child is earlier in time */
77 u8 bDescender; /* True if riser from bottom of graph to here. */
 
78 i8 iRail; /* Which rail this check-in appears on. 0-based.*/
79 i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
80 u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
81 int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
82 int mergeUpto; /* Draw the mergeOut rail up to this level */
@@ -319,11 +320,13 @@
319 }
320 /* Mask of additional rows for the riser to infinity */
321 if( !pPrior->isLeaf && (tmFlags & TIMELINE_DISJOINT)==0 ){
322 int n = RISER_MARGIN;
323 GraphRow *p;
 
324 for(p=pPrior; p && (n--)>0; p=p->pPrev){
 
325 p->railInUse |= mask;
326 }
327 }
328 }
329
@@ -345,16 +348,17 @@
345 if( u>0 && u<pChild->idx ){
346 /* The thick arrow up to the next primary child of pDesc goes
347 ** further up than the thin merge arrow riser, so draw them both
348 ** on the same rail. */
349 pParent->mergeOut = pParent->iRail;
 
 
350 }else{
351 /* The thin merge arrow riser is taller than the thick primary
352 ** child riser, so use separate rails. */
353 int iTarget = pParent->iRail;
354 int iBtm = pParent->idx - (u==0 ? RISER_MARGIN : 1);
355 pParent->mergeOut = findFreeRail(p, pChild->idx, iBtm, iTarget);
356 mask = BIT(pParent->mergeOut);
357 for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
358 pLoop=pLoop->pNext){
359 pLoop->railInUse |= mask;
360 }
361
--- src/graph.c
+++ src/graph.c
@@ -73,10 +73,11 @@
73 u8 isLeaf; /* True if this is a leaf node */
74 u8 isStepParent; /* pChild is actually a step-child */
75 u8 hasNormalOutMerge; /* Is parent of at laest 1 non-cherrypick merge */
76 u8 timeWarp; /* Child is earlier in time */
77 u8 bDescender; /* True if riser from bottom of graph to here. */
78 u8 selfUp; /* Space above this node but belonging */
79 i8 iRail; /* Which rail this check-in appears on. 0-based.*/
80 i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
81 u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
82 int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
83 int mergeUpto; /* Draw the mergeOut rail up to this level */
@@ -319,11 +320,13 @@
320 }
321 /* Mask of additional rows for the riser to infinity */
322 if( !pPrior->isLeaf && (tmFlags & TIMELINE_DISJOINT)==0 ){
323 int n = RISER_MARGIN;
324 GraphRow *p;
325 pPrior->selfUp = 0;
326 for(p=pPrior; p && (n--)>0; p=p->pPrev){
327 pPrior->selfUp++;
328 p->railInUse |= mask;
329 }
330 }
331 }
332
@@ -345,16 +348,17 @@
348 if( u>0 && u<pChild->idx ){
349 /* The thick arrow up to the next primary child of pDesc goes
350 ** further up than the thin merge arrow riser, so draw them both
351 ** on the same rail. */
352 pParent->mergeOut = pParent->iRail;
353 }else if( pParent->idx - pChild->idx < pParent->selfUp ){
354 pParent->mergeOut = pParent->iRail;
355 }else{
356 /* The thin merge arrow riser is taller than the thick primary
357 ** child riser, so use separate rails. */
358 int iTarget = pParent->iRail;
359 pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1, iTarget);
 
360 mask = BIT(pParent->mergeOut);
361 for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
362 pLoop=pLoop->pNext){
363 pLoop->railInUse |= mask;
364 }
365

Keyboard Shortcuts

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