Fossil SCM

Increase the maximum graph with to 40 rails. Fix the graph display for individual files, which was broken by the prior change.

drh 2012-12-06 02:44 trunk
Commit 8d4ee62b1876a1721057d5afd0e52b90b1e8e20f
3 files changed +2 -1 +25 -20 +1 -3
+2 -1
--- src/finfo.c
+++ src/finfo.c
@@ -442,12 +442,13 @@
442442
graph_finish(pGraph, 0);
443443
if( pGraph->nErr ){
444444
graph_free(pGraph);
445445
pGraph = 0;
446446
}else{
447
+ int w = (pGraph->mxRail+1)*pGraph->iRailPitch + 10;
447448
@ <tr><td></td><td>
448
- @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
449
+ @ <div id="grbtm" style="width:%d(w)px;"></div>
449450
@ </td><td></td></tr>
450451
}
451452
}
452453
@ </table>
453454
timeline_output_graph_javascript(pGraph, 0, 1);
454455
--- src/finfo.c
+++ src/finfo.c
@@ -442,12 +442,13 @@
442 graph_finish(pGraph, 0);
443 if( pGraph->nErr ){
444 graph_free(pGraph);
445 pGraph = 0;
446 }else{
 
447 @ <tr><td></td><td>
448 @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
449 @ </td><td></td></tr>
450 }
451 }
452 @ </table>
453 timeline_output_graph_javascript(pGraph, 0, 1);
454
--- src/finfo.c
+++ src/finfo.c
@@ -442,12 +442,13 @@
442 graph_finish(pGraph, 0);
443 if( pGraph->nErr ){
444 graph_free(pGraph);
445 pGraph = 0;
446 }else{
447 int w = (pGraph->mxRail+1)*pGraph->iRailPitch + 10;
448 @ <tr><td></td><td>
449 @ <div id="grbtm" style="width:%d(w)px;"></div>
450 @ </td><td></td></tr>
451 }
452 }
453 @ </table>
454 timeline_output_graph_javascript(pGraph, 0, 1);
455
+25 -20
--- src/graph.c
+++ src/graph.c
@@ -21,11 +21,11 @@
2121
#include "graph.h"
2222
#include <assert.h>
2323
2424
#if INTERFACE
2525
26
-#define GR_MAX_RAIL 32 /* Max number of "rails" to display */
26
+#define GR_MAX_RAIL 40 /* Max number of "rails" to display */
2727
2828
/* The graph appears vertically beside a timeline. Each row in the
2929
** timeline corresponds to a row in the graph. GraphRow.idx is 0 for
3030
** the top-most row and increases moving down. Hence (in the absence of
3131
** time skew) parents have a larger index than their children.
@@ -51,13 +51,13 @@
5151
i8 iRail; /* Which rail this check-in appears on. 0-based.*/
5252
i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
5353
u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
5454
int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
5555
int mergeUpto; /* Draw the mergeOut rail up to this level */
56
- u32 mergeDown; /* Draw merge lines up from bottom of graph */
56
+ u64 mergeDown; /* Draw merge lines up from bottom of graph */
5757
58
- u32 railInUse; /* Mask of occupied rails at this row */
58
+ u64 railInUse; /* Mask of occupied rails at this row */
5959
};
6060
6161
/* Context while building a graph
6262
*/
6363
struct GraphContext {
@@ -73,10 +73,13 @@
7373
GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
7474
};
7575
7676
#endif
7777
78
+/* The N-th bit */
79
+#define BIT(N) (((u64)1)<<(N))
80
+
7881
/*
7982
** Malloc for zeroed space. Panic if unable to provide the
8083
** requested space.
8184
*/
8285
void *safeMalloc(int nByte){
@@ -216,11 +219,11 @@
216219
** top and bottom, inclusive.
217220
*/
218221
static int findFreeRail(
219222
GraphContext *p, /* The graph context */
220223
int top, int btm, /* Span of rows for which the rail is needed */
221
- u32 inUseMask, /* Mask or rails already in use */
224
+ u64 inUseMask, /* Mask or rails already in use */
222225
int iNearto /* Find rail nearest to this rail */
223226
){
224227
GraphRow *pRow;
225228
int i;
226229
int iBest = 0;
@@ -229,11 +232,11 @@
229232
while( pRow && pRow->idx<=btm ){
230233
inUseMask |= pRow->railInUse;
231234
pRow = pRow->pNext;
232235
}
233236
for(i=0; i<32; i++){
234
- if( (inUseMask & (1<<i))==0 ){
237
+ if( (inUseMask & BIT(i))==0 ){
235238
int dist;
236239
if( iNearto<=0 ){
237240
return i;
238241
}
239242
dist = i - iNearto;
@@ -254,11 +257,11 @@
254257
*/
255258
static void assignChildrenToRail(GraphRow *pBottom){
256259
int iRail = pBottom->iRail;
257260
GraphRow *pCurrent;
258261
GraphRow *pPrior;
259
- u32 mask = 1<<iRail;
262
+ u64 mask = ((u64)1)<<iRail;
260263
261264
pBottom->iRail = iRail;
262265
pBottom->railInUse |= mask;
263266
pPrior = pBottom;
264267
for(pCurrent=pBottom->pChild; pCurrent; pCurrent=pCurrent->pChild){
@@ -282,11 +285,11 @@
282285
GraphContext *p,
283286
GraphRow *pParent,
284287
GraphRow *pChild
285288
){
286289
int u;
287
- u32 mask;
290
+ u64 mask;
288291
GraphRow *pLoop;
289292
290293
if( pParent->mergeOut<0 ){
291294
u = pParent->aiRiser[pParent->iRail];
292295
if( u>=0 && u<pChild->idx ){
@@ -301,11 +304,11 @@
301304
** child riser, so use separate rails. */
302305
int iTarget = pParent->iRail;
303306
pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1,
304307
0, iTarget)*4 + 1;
305308
pParent->mergeUpto = pChild->idx;
306
- mask = 1<<(pParent->mergeOut/4);
309
+ mask = BIT(pParent->mergeOut/4);
307310
for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
308311
pLoop=pLoop->pNext){
309312
pLoop->railInUse |= mask;
310313
}
311314
}
@@ -320,11 +323,11 @@
320323
GraphRow *pRow;
321324
p->mxRail = 0;
322325
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
323326
if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail;
324327
if( pRow->mergeOut/4>p->mxRail ) p->mxRail = pRow->mergeOut/4;
325
- while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>((1<<(p->mxRail+1))-1) ){
328
+ while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>(BIT(p->mxRail+1)-1) ){
326329
p->mxRail++;
327330
}
328331
}
329332
}
330333
@@ -333,12 +336,12 @@
333336
** Compute the complete graph
334337
*/
335338
void graph_finish(GraphContext *p, int omitDescenders){
336339
GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
337340
int i;
338
- u32 mask;
339
- u32 inUse;
341
+ u64 mask;
342
+ u64 inUse;
340343
int hasDup = 0; /* True if one or more isDup entries */
341344
const char *zTrunk;
342345
343346
if( p==0 || p->pFirst==0 || p->nErr ) return;
344347
p->nErr = 1; /* Assume an error until proven otherwise */
@@ -423,11 +426,11 @@
423426
pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx, 0, 0);
424427
}else{
425428
pRow->iRail = ++p->mxRail;
426429
}
427430
if( p->mxRail>=GR_MAX_RAIL ) return;
428
- mask = 1<<(pRow->iRail);
431
+ mask = BIT(pRow->iRail);
429432
if( !omitDescenders ){
430433
pRow->bDescender = pRow->nParent>0;
431434
for(pLoop=pRow; pLoop; pLoop=pLoop->pNext){
432435
pLoop->railInUse |= mask;
433436
}
@@ -437,21 +440,21 @@
437440
}
438441
}
439442
440443
/* Assign rails to all rows that are still unassigned.
441444
*/
442
- inUse = (1<<(p->mxRail+1))-1;
445
+ inUse = BIT(p->mxRail+1) - 1;
443446
for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
444447
int parentRid;
445448
446449
if( pRow->iRail>=0 ){
447450
if( pRow->pChild==0 && !pRow->timeWarp ){
448451
if( omitDescenders || count_nonbranch_children(pRow->rid)==0 ){
449
- inUse &= ~(1<<pRow->iRail);
452
+ inUse &= ~BIT(pRow->iRail);
450453
}else{
451454
pRow->aiRiser[pRow->iRail] = 0;
452
- mask = 1<<pRow->iRail;
455
+ mask = BIT(pRow->iRail);
453456
for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){
454457
pLoop->railInUse |= mask;
455458
}
456459
}
457460
}
@@ -464,11 +467,11 @@
464467
parentRid = pRow->aParent[0];
465468
pParent = hashFind(p, parentRid);
466469
if( pParent==0 ){
467470
pRow->iRail = ++p->mxRail;
468471
if( p->mxRail>=GR_MAX_RAIL ) return;
469
- pRow->railInUse = 1<<pRow->iRail;
472
+ pRow->railInUse = BIT(pRow->iRail);
470473
continue;
471474
}
472475
if( pParent->idx>pRow->idx ){
473476
/* Common case: Child occurs after parent and is above the
474477
** parent in the timeline */
@@ -480,20 +483,20 @@
480483
** appears below the parent in the timeline. */
481484
int iDownRail = ++p->mxRail;
482485
if( iDownRail<1 ) iDownRail = ++p->mxRail;
483486
pRow->iRail = ++p->mxRail;
484487
if( p->mxRail>=GR_MAX_RAIL ) return;
485
- pRow->railInUse = 1<<pRow->iRail;
488
+ pRow->railInUse = BIT(pRow->iRail);
486489
pParent->aiRiser[iDownRail] = pRow->idx;
487
- mask = 1<<iDownRail;
490
+ mask = BIT(iDownRail);
488491
inUse |= mask;
489492
for(pLoop=p->pFirst; pLoop; pLoop=pLoop->pNext){
490493
pLoop->railInUse |= mask;
491494
}
492495
}
493496
}
494
- mask = 1<<pRow->iRail;
497
+ mask = BIT(pRow->iRail);
495498
pRow->railInUse |= mask;
496499
if( pRow->pChild==0 ){
497500
inUse &= ~mask;
498501
}else{
499502
inUse |= mask;
@@ -515,11 +518,11 @@
515518
pDesc = hashFind(p, parentRid);
516519
if( pDesc==0 ){
517520
/* Merge from a node that is off-screen */
518521
int iMrail = findFreeRail(p, pRow->idx, p->nRow, 0, 0);
519522
if( p->mxRail>=GR_MAX_RAIL ) return;
520
- mask = 1<<iMrail;
523
+ mask = BIT(iMrail);
521524
pRow->mergeIn[iMrail] = 2;
522525
pRow->mergeDown |= mask;
523526
for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){
524527
pLoop->railInUse |= mask;
525528
}
@@ -560,7 +563,9 @@
560563
561564
/*
562565
** Find the maximum rail number.
563566
*/
564567
find_max_rail(p);
568
+ p->iRailPitch = 18 - (p->mxRail/3);
569
+ if( p->iRailPitch<12 ) p->iRailPitch = 12;
565570
p->nErr = 0;
566571
}
567572
--- src/graph.c
+++ src/graph.c
@@ -21,11 +21,11 @@
21 #include "graph.h"
22 #include <assert.h>
23
24 #if INTERFACE
25
26 #define GR_MAX_RAIL 32 /* Max number of "rails" to display */
27
28 /* The graph appears vertically beside a timeline. Each row in the
29 ** timeline corresponds to a row in the graph. GraphRow.idx is 0 for
30 ** the top-most row and increases moving down. Hence (in the absence of
31 ** time skew) parents have a larger index than their children.
@@ -51,13 +51,13 @@
51 i8 iRail; /* Which rail this check-in appears on. 0-based.*/
52 i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
53 u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
54 int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
55 int mergeUpto; /* Draw the mergeOut rail up to this level */
56 u32 mergeDown; /* Draw merge lines up from bottom of graph */
57
58 u32 railInUse; /* Mask of occupied rails at this row */
59 };
60
61 /* Context while building a graph
62 */
63 struct GraphContext {
@@ -73,10 +73,13 @@
73 GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
74 };
75
76 #endif
77
 
 
 
78 /*
79 ** Malloc for zeroed space. Panic if unable to provide the
80 ** requested space.
81 */
82 void *safeMalloc(int nByte){
@@ -216,11 +219,11 @@
216 ** top and bottom, inclusive.
217 */
218 static int findFreeRail(
219 GraphContext *p, /* The graph context */
220 int top, int btm, /* Span of rows for which the rail is needed */
221 u32 inUseMask, /* Mask or rails already in use */
222 int iNearto /* Find rail nearest to this rail */
223 ){
224 GraphRow *pRow;
225 int i;
226 int iBest = 0;
@@ -229,11 +232,11 @@
229 while( pRow && pRow->idx<=btm ){
230 inUseMask |= pRow->railInUse;
231 pRow = pRow->pNext;
232 }
233 for(i=0; i<32; i++){
234 if( (inUseMask & (1<<i))==0 ){
235 int dist;
236 if( iNearto<=0 ){
237 return i;
238 }
239 dist = i - iNearto;
@@ -254,11 +257,11 @@
254 */
255 static void assignChildrenToRail(GraphRow *pBottom){
256 int iRail = pBottom->iRail;
257 GraphRow *pCurrent;
258 GraphRow *pPrior;
259 u32 mask = 1<<iRail;
260
261 pBottom->iRail = iRail;
262 pBottom->railInUse |= mask;
263 pPrior = pBottom;
264 for(pCurrent=pBottom->pChild; pCurrent; pCurrent=pCurrent->pChild){
@@ -282,11 +285,11 @@
282 GraphContext *p,
283 GraphRow *pParent,
284 GraphRow *pChild
285 ){
286 int u;
287 u32 mask;
288 GraphRow *pLoop;
289
290 if( pParent->mergeOut<0 ){
291 u = pParent->aiRiser[pParent->iRail];
292 if( u>=0 && u<pChild->idx ){
@@ -301,11 +304,11 @@
301 ** child riser, so use separate rails. */
302 int iTarget = pParent->iRail;
303 pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1,
304 0, iTarget)*4 + 1;
305 pParent->mergeUpto = pChild->idx;
306 mask = 1<<(pParent->mergeOut/4);
307 for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
308 pLoop=pLoop->pNext){
309 pLoop->railInUse |= mask;
310 }
311 }
@@ -320,11 +323,11 @@
320 GraphRow *pRow;
321 p->mxRail = 0;
322 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
323 if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail;
324 if( pRow->mergeOut/4>p->mxRail ) p->mxRail = pRow->mergeOut/4;
325 while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>((1<<(p->mxRail+1))-1) ){
326 p->mxRail++;
327 }
328 }
329 }
330
@@ -333,12 +336,12 @@
333 ** Compute the complete graph
334 */
335 void graph_finish(GraphContext *p, int omitDescenders){
336 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
337 int i;
338 u32 mask;
339 u32 inUse;
340 int hasDup = 0; /* True if one or more isDup entries */
341 const char *zTrunk;
342
343 if( p==0 || p->pFirst==0 || p->nErr ) return;
344 p->nErr = 1; /* Assume an error until proven otherwise */
@@ -423,11 +426,11 @@
423 pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx, 0, 0);
424 }else{
425 pRow->iRail = ++p->mxRail;
426 }
427 if( p->mxRail>=GR_MAX_RAIL ) return;
428 mask = 1<<(pRow->iRail);
429 if( !omitDescenders ){
430 pRow->bDescender = pRow->nParent>0;
431 for(pLoop=pRow; pLoop; pLoop=pLoop->pNext){
432 pLoop->railInUse |= mask;
433 }
@@ -437,21 +440,21 @@
437 }
438 }
439
440 /* Assign rails to all rows that are still unassigned.
441 */
442 inUse = (1<<(p->mxRail+1))-1;
443 for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
444 int parentRid;
445
446 if( pRow->iRail>=0 ){
447 if( pRow->pChild==0 && !pRow->timeWarp ){
448 if( omitDescenders || count_nonbranch_children(pRow->rid)==0 ){
449 inUse &= ~(1<<pRow->iRail);
450 }else{
451 pRow->aiRiser[pRow->iRail] = 0;
452 mask = 1<<pRow->iRail;
453 for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){
454 pLoop->railInUse |= mask;
455 }
456 }
457 }
@@ -464,11 +467,11 @@
464 parentRid = pRow->aParent[0];
465 pParent = hashFind(p, parentRid);
466 if( pParent==0 ){
467 pRow->iRail = ++p->mxRail;
468 if( p->mxRail>=GR_MAX_RAIL ) return;
469 pRow->railInUse = 1<<pRow->iRail;
470 continue;
471 }
472 if( pParent->idx>pRow->idx ){
473 /* Common case: Child occurs after parent and is above the
474 ** parent in the timeline */
@@ -480,20 +483,20 @@
480 ** appears below the parent in the timeline. */
481 int iDownRail = ++p->mxRail;
482 if( iDownRail<1 ) iDownRail = ++p->mxRail;
483 pRow->iRail = ++p->mxRail;
484 if( p->mxRail>=GR_MAX_RAIL ) return;
485 pRow->railInUse = 1<<pRow->iRail;
486 pParent->aiRiser[iDownRail] = pRow->idx;
487 mask = 1<<iDownRail;
488 inUse |= mask;
489 for(pLoop=p->pFirst; pLoop; pLoop=pLoop->pNext){
490 pLoop->railInUse |= mask;
491 }
492 }
493 }
494 mask = 1<<pRow->iRail;
495 pRow->railInUse |= mask;
496 if( pRow->pChild==0 ){
497 inUse &= ~mask;
498 }else{
499 inUse |= mask;
@@ -515,11 +518,11 @@
515 pDesc = hashFind(p, parentRid);
516 if( pDesc==0 ){
517 /* Merge from a node that is off-screen */
518 int iMrail = findFreeRail(p, pRow->idx, p->nRow, 0, 0);
519 if( p->mxRail>=GR_MAX_RAIL ) return;
520 mask = 1<<iMrail;
521 pRow->mergeIn[iMrail] = 2;
522 pRow->mergeDown |= mask;
523 for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){
524 pLoop->railInUse |= mask;
525 }
@@ -560,7 +563,9 @@
560
561 /*
562 ** Find the maximum rail number.
563 */
564 find_max_rail(p);
 
 
565 p->nErr = 0;
566 }
567
--- src/graph.c
+++ src/graph.c
@@ -21,11 +21,11 @@
21 #include "graph.h"
22 #include <assert.h>
23
24 #if INTERFACE
25
26 #define GR_MAX_RAIL 40 /* Max number of "rails" to display */
27
28 /* The graph appears vertically beside a timeline. Each row in the
29 ** timeline corresponds to a row in the graph. GraphRow.idx is 0 for
30 ** the top-most row and increases moving down. Hence (in the absence of
31 ** time skew) parents have a larger index than their children.
@@ -51,13 +51,13 @@
51 i8 iRail; /* Which rail this check-in appears on. 0-based.*/
52 i8 mergeOut; /* Merge out to this rail. -1 if no merge-out */
53 u8 mergeIn[GR_MAX_RAIL]; /* Merge in from non-zero rails */
54 int aiRiser[GR_MAX_RAIL]; /* Risers from this node to a higher row. */
55 int mergeUpto; /* Draw the mergeOut rail up to this level */
56 u64 mergeDown; /* Draw merge lines up from bottom of graph */
57
58 u64 railInUse; /* Mask of occupied rails at this row */
59 };
60
61 /* Context while building a graph
62 */
63 struct GraphContext {
@@ -73,10 +73,13 @@
73 GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
74 };
75
76 #endif
77
78 /* The N-th bit */
79 #define BIT(N) (((u64)1)<<(N))
80
81 /*
82 ** Malloc for zeroed space. Panic if unable to provide the
83 ** requested space.
84 */
85 void *safeMalloc(int nByte){
@@ -216,11 +219,11 @@
219 ** top and bottom, inclusive.
220 */
221 static int findFreeRail(
222 GraphContext *p, /* The graph context */
223 int top, int btm, /* Span of rows for which the rail is needed */
224 u64 inUseMask, /* Mask or rails already in use */
225 int iNearto /* Find rail nearest to this rail */
226 ){
227 GraphRow *pRow;
228 int i;
229 int iBest = 0;
@@ -229,11 +232,11 @@
232 while( pRow && pRow->idx<=btm ){
233 inUseMask |= pRow->railInUse;
234 pRow = pRow->pNext;
235 }
236 for(i=0; i<32; i++){
237 if( (inUseMask & BIT(i))==0 ){
238 int dist;
239 if( iNearto<=0 ){
240 return i;
241 }
242 dist = i - iNearto;
@@ -254,11 +257,11 @@
257 */
258 static void assignChildrenToRail(GraphRow *pBottom){
259 int iRail = pBottom->iRail;
260 GraphRow *pCurrent;
261 GraphRow *pPrior;
262 u64 mask = ((u64)1)<<iRail;
263
264 pBottom->iRail = iRail;
265 pBottom->railInUse |= mask;
266 pPrior = pBottom;
267 for(pCurrent=pBottom->pChild; pCurrent; pCurrent=pCurrent->pChild){
@@ -282,11 +285,11 @@
285 GraphContext *p,
286 GraphRow *pParent,
287 GraphRow *pChild
288 ){
289 int u;
290 u64 mask;
291 GraphRow *pLoop;
292
293 if( pParent->mergeOut<0 ){
294 u = pParent->aiRiser[pParent->iRail];
295 if( u>=0 && u<pChild->idx ){
@@ -301,11 +304,11 @@
304 ** child riser, so use separate rails. */
305 int iTarget = pParent->iRail;
306 pParent->mergeOut = findFreeRail(p, pChild->idx, pParent->idx-1,
307 0, iTarget)*4 + 1;
308 pParent->mergeUpto = pChild->idx;
309 mask = BIT(pParent->mergeOut/4);
310 for(pLoop=pChild->pNext; pLoop && pLoop->rid!=pParent->rid;
311 pLoop=pLoop->pNext){
312 pLoop->railInUse |= mask;
313 }
314 }
@@ -320,11 +323,11 @@
323 GraphRow *pRow;
324 p->mxRail = 0;
325 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
326 if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail;
327 if( pRow->mergeOut/4>p->mxRail ) p->mxRail = pRow->mergeOut/4;
328 while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>(BIT(p->mxRail+1)-1) ){
329 p->mxRail++;
330 }
331 }
332 }
333
@@ -333,12 +336,12 @@
336 ** Compute the complete graph
337 */
338 void graph_finish(GraphContext *p, int omitDescenders){
339 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
340 int i;
341 u64 mask;
342 u64 inUse;
343 int hasDup = 0; /* True if one or more isDup entries */
344 const char *zTrunk;
345
346 if( p==0 || p->pFirst==0 || p->nErr ) return;
347 p->nErr = 1; /* Assume an error until proven otherwise */
@@ -423,11 +426,11 @@
426 pRow->iRail = findFreeRail(p, pRow->idxTop, pRow->idx, 0, 0);
427 }else{
428 pRow->iRail = ++p->mxRail;
429 }
430 if( p->mxRail>=GR_MAX_RAIL ) return;
431 mask = BIT(pRow->iRail);
432 if( !omitDescenders ){
433 pRow->bDescender = pRow->nParent>0;
434 for(pLoop=pRow; pLoop; pLoop=pLoop->pNext){
435 pLoop->railInUse |= mask;
436 }
@@ -437,21 +440,21 @@
440 }
441 }
442
443 /* Assign rails to all rows that are still unassigned.
444 */
445 inUse = BIT(p->mxRail+1) - 1;
446 for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
447 int parentRid;
448
449 if( pRow->iRail>=0 ){
450 if( pRow->pChild==0 && !pRow->timeWarp ){
451 if( omitDescenders || count_nonbranch_children(pRow->rid)==0 ){
452 inUse &= ~BIT(pRow->iRail);
453 }else{
454 pRow->aiRiser[pRow->iRail] = 0;
455 mask = BIT(pRow->iRail);
456 for(pLoop=pRow; pLoop; pLoop=pLoop->pPrev){
457 pLoop->railInUse |= mask;
458 }
459 }
460 }
@@ -464,11 +467,11 @@
467 parentRid = pRow->aParent[0];
468 pParent = hashFind(p, parentRid);
469 if( pParent==0 ){
470 pRow->iRail = ++p->mxRail;
471 if( p->mxRail>=GR_MAX_RAIL ) return;
472 pRow->railInUse = BIT(pRow->iRail);
473 continue;
474 }
475 if( pParent->idx>pRow->idx ){
476 /* Common case: Child occurs after parent and is above the
477 ** parent in the timeline */
@@ -480,20 +483,20 @@
483 ** appears below the parent in the timeline. */
484 int iDownRail = ++p->mxRail;
485 if( iDownRail<1 ) iDownRail = ++p->mxRail;
486 pRow->iRail = ++p->mxRail;
487 if( p->mxRail>=GR_MAX_RAIL ) return;
488 pRow->railInUse = BIT(pRow->iRail);
489 pParent->aiRiser[iDownRail] = pRow->idx;
490 mask = BIT(iDownRail);
491 inUse |= mask;
492 for(pLoop=p->pFirst; pLoop; pLoop=pLoop->pNext){
493 pLoop->railInUse |= mask;
494 }
495 }
496 }
497 mask = BIT(pRow->iRail);
498 pRow->railInUse |= mask;
499 if( pRow->pChild==0 ){
500 inUse &= ~mask;
501 }else{
502 inUse |= mask;
@@ -515,11 +518,11 @@
518 pDesc = hashFind(p, parentRid);
519 if( pDesc==0 ){
520 /* Merge from a node that is off-screen */
521 int iMrail = findFreeRail(p, pRow->idx, p->nRow, 0, 0);
522 if( p->mxRail>=GR_MAX_RAIL ) return;
523 mask = BIT(iMrail);
524 pRow->mergeIn[iMrail] = 2;
525 pRow->mergeDown |= mask;
526 for(pLoop=pRow->pNext; pLoop; pLoop=pLoop->pNext){
527 pLoop->railInUse |= mask;
528 }
@@ -560,7 +563,9 @@
563
564 /*
565 ** Find the maximum rail number.
566 */
567 find_max_rail(p);
568 p->iRailPitch = 18 - (p->mxRail/3);
569 if( p->iRailPitch<12 ) p->iRailPitch = 12;
570 p->nErr = 0;
571 }
572
+1 -3
--- src/timeline.c
+++ src/timeline.c
@@ -487,13 +487,11 @@
487487
}else{
488488
int w;
489489
/* style is not moved to css, because this is
490490
** a technical div for the timeline graph
491491
*/
492
- pGraph->iRailPitch = 18 - (pGraph->mxRail/3);
493
- if( pGraph->iRailPitch<12 ) pGraph->iRailPitch = 12;
494
- w = pGraph->mxRail*pGraph->iRailPitch + 30;
492
+ w = (pGraph->mxRail+1)*pGraph->iRailPitch + 10;
495493
@ <tr><td></td><td>
496494
@ <div id="grbtm" style="width:%d(w)px;"></div>
497495
@ </td><td></td></tr>
498496
}
499497
}
500498
--- src/timeline.c
+++ src/timeline.c
@@ -487,13 +487,11 @@
487 }else{
488 int w;
489 /* style is not moved to css, because this is
490 ** a technical div for the timeline graph
491 */
492 pGraph->iRailPitch = 18 - (pGraph->mxRail/3);
493 if( pGraph->iRailPitch<12 ) pGraph->iRailPitch = 12;
494 w = pGraph->mxRail*pGraph->iRailPitch + 30;
495 @ <tr><td></td><td>
496 @ <div id="grbtm" style="width:%d(w)px;"></div>
497 @ </td><td></td></tr>
498 }
499 }
500
--- src/timeline.c
+++ src/timeline.c
@@ -487,13 +487,11 @@
487 }else{
488 int w;
489 /* style is not moved to css, because this is
490 ** a technical div for the timeline graph
491 */
492 w = (pGraph->mxRail+1)*pGraph->iRailPitch + 10;
 
 
493 @ <tr><td></td><td>
494 @ <div id="grbtm" style="width:%d(w)px;"></div>
495 @ </td><td></td></tr>
496 }
497 }
498

Keyboard Shortcuts

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