Fossil

Check-in [236586d6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Attempt to draw the entire length of a cherrypick merge line using a dashed line.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 236586d6f20e7c40579ea6c3535ace63d445e4adef06fabba861a7a7ba5f5cd5
User & Date: drh 2018-12-27 19:55:42
Context
2018-12-28
12:59
This checkin does a cherrypick merge off of another checkin that already has a prior full merge. The purpose of this checkin is to provide a test case for the cherrypick graph drawing logic. The code in this checkin is not intended to actually be used for anything. Leaf check-in: dc81ac70 user: drh tags: graph-test-branch
2018-12-27
20:13
Fix a problem in which normal merge arrows were often drawn as normal merge arrows. check-in: 8b3e3e00 user: drh tags: trunk
19:55
Attempt to draw the entire length of a cherrypick merge line using a dashed line. check-in: 236586d6 user: drh tags: trunk
19:39
Show cherrypick merges on the default timeline. Disable the display of cherrypicks using the "ncp" query parameter. Currently, the only display difference between a normal merge and a cherrypick merges is in the final horizontal segment of the merge line as it moves into the child node. More work is needed on the display logic. check-in: 55ab522c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/default_css.txt.

   170    170   }
   171    171   .tl-arrow.cherrypick.r {
   172    172     border-left: 3px solid #000;
   173    173   }
   174    174   .tl-line.cherrypick {
   175    175     width: 0px;
   176    176     border-top: 1px dashed #000;
          177  +  border-left: 1px dashed #000;
   177    178     background: #fff;
   178    179   }
   179    180   .tl-arrow.warp {
   180    181     margin-left: 1px;
   181    182     border-width: 3px 0;
   182    183     border-left: 7px solid #600000;
   183    184   }

Changes to src/graph.js.

   242    242         if( p.hasOwnProperty('d') ) drawUpArrow({x: p.x, y: btm-node.h/2},p,p.fg);
   243    243       }
   244    244       if( p.hasOwnProperty('mo') ){
   245    245         var x0 = p.x + node.w/2;
   246    246         var x1 = p.mo*railPitch + node.w/2;
   247    247         var u = tx.rowinfo[p.mu-tx.iTopRow];
   248    248         var y1 = miLineY(u);
          249  +      var drawMethod = (p.f&2) ? drawCherrypickLine : drawMergeLine;
   249    250         if( p.u<0 || p.mo!=p.r ){
   250    251           x1 += mergeLines[p.mo] = -mLine.w/2;
   251    252           var y0 = p.y+2;
   252         -        if( p.r!=p.mo ) drawMergeLine(x0,y0,x1+(x0<x1 ? mLine.w : 0),null);
   253         -        drawMergeLine(x1,y0+mLine.w,null,y1);
          253  +        if( p.r!=p.mo ) drawMethod(x0,y0,x1+(x0<x1 ? mLine.w : 0),null);
          254  +        drawMethod(x1,y0+mLine.w,null,y1);
   254    255         }else if( mergeOffset ){
   255    256           mergeLines[p.mo] = u.r<p.r ? -mergeOffset-mLine.w : mergeOffset;
   256    257           x1 += mergeLines[p.mo];
   257         -        drawMergeLine(x1,p.y+node.h/2,null,y1);
          258  +        drawMethod(x1,p.y+node.h/2,null,y1);
   258    259         }else{
   259    260           delete mergeLines[p.mo];
   260    261         }
   261    262       }
   262    263       if( p.hasOwnProperty('au') ){
   263    264         for( var i=0; i<p.au.length; i+=2 ){
   264    265           var rail = p.au[i];
................................................................................
   300    301       if( p.hasOwnProperty('cpi') ){
   301    302         for( var i=0; i<p.cpi.length; i++ ){
   302    303           var rail = p.cpi[i];
   303    304           if( rail<0 ){
   304    305             rail = -rail;
   305    306             mergeLines[rail] = -mLine.w/2;
   306    307             var x = rail*railPitch + (node.w-mLine.w)/2;
   307         -          drawMergeLine(x,miLineY(p),null,btm);
          308  +          drawCherrypickLine(x,miLineY(p),null,btm);
   308    309           }
   309    310           drawMergeArrow(p,rail,1);
   310    311         }
   311    312       }
   312    313     }
   313    314     var mergeLines;
   314    315     function renderGraph(){

Changes to src/timeline.c.

   873    873       **        node has no merge children and no merge-out line is drawn.
   874    874       **   mu:  The id of the row which is the top of the merge-out arrow.
   875    875       **        Only exists if "mo" exists.
   876    876       **    u:  Draw a thick child-line out of the top of this node and up to
   877    877       **        the node with an id equal to this value.  0 if it is straight to
   878    878       **        the top of the page, -1 if there is no thick-line riser.
   879    879       **    f:  0x01: a leaf node.
          880  +    **        0x02: all output merges are cherrypicks
   880    881       **   au:  An array of integers that define thick-line risers for branches.
   881    882       **        The integers are in pairs.  For each pair, the first integer is
   882    883       **        is the rail on which the riser should run and the second integer
   883    884       **        is the id of the node upto which the riser should run. If there
   884    885       **        are no risers, this array does not exist.
   885    886       **   mi:  "merge-in".  An array of integer rail positions from which
   886    887       **        merge arrows should be drawn into this node.  If the value is
................................................................................
   901    902           cgi_printf("\"d\":%d,",       pRow->bDescender);
   902    903         }
   903    904         if( pRow->mergeOut>=0 ){
   904    905           cgi_printf("\"mo\":%d,",      pRow->mergeOut);
   905    906           cgi_printf("\"mu\":%d,",      pRow->mergeUpto);
   906    907         }
   907    908         cgi_printf("\"u\":%d,",       pRow->aiRiser[pRow->iRail]);
   908         -      cgi_printf("\"f\":%d,",       pRow->isLeaf ? 1 : 0);
          909  +      k = 0;
          910  +      if( pRow->isLeaf ) k |= 1;
          911  +      if( pRow->nCherrypick>=pRow->nParent-1 ) k |= 2;
          912  +      cgi_printf("\"f\":%d,",k);
   909    913         for(i=k=0; i<GR_MAX_RAIL; i++){
   910    914           if( i==pRow->iRail ) continue;
   911    915           if( pRow->aiRiser[i]>0 ){
   912    916             if( k==0 ){
   913    917               cgi_printf("\"au\":");
   914    918               cSep = '[';
   915    919             }