tools/geom/diagonals.js
function drawBadCells(cells) {
  var context = c.getContext('2d');
  var canvas = c; // from global.
  // Drawing bad cells
  var draw_loc = {x: 0, y: 0};
  for (var i = 0; i < cells.length; i++) {
    var cell_info = cells[i];
    var cell = cell_info[0];
    var matched_entrances = cell_info[1];
    var matched_exits = cell_info[2]

    // Write information.
    context.fillStyle = 'black';
    context.fillText(cell.toString(), draw_loc.x + 5, draw_loc.y + 10)
    context.fillText("ents:" + matched_entrances.length, draw_loc.x + 5, draw_loc.y + 20)
    context.fillText("exts:" + matched_exits.length, draw_loc.x + 5, draw_loc.y + 35)

    drawCell(cell, canvas, {x: draw_loc.x + text_width, y: draw_loc.y});
    // Increment drawing location.
    if ((i % 5) == 4) {
      draw_loc = {x: 0, y: draw_loc.y + total_width};
    } else {
      draw_loc = {x: draw_loc.x + total_width, y: draw_loc.y};
    }
  }
}
function drawBadCells(cells) {
  var context = c.getContext('2d');
  var canvas = c; // from global.
  // Drawing bad cells
  var draw_loc = {x: 0, y: 0};
  for (var i = 0; i < cells.length; i++) {
    var cell_info = cells[i];
    var cell = cell_info[0];
    var matched_entrances = cell_info[1];
    var matched_exits = cell_info[2]

    // Write information.
    context.fillStyle = 'black';
    context.fillText(cell.toString(), draw_loc.x + 5, draw_loc.y + 10)
    context.fillText("ents:" + matched_entrances.length, draw_loc.x + 5, draw_loc.y + 20)
    context.fillText("exts:" + matched_exits.length, draw_loc.x + 5, draw_loc.y + 35)

    drawCell(cell, canvas, {x: draw_loc.x + text_width, y: draw_loc.y});
    // Increment drawing location.
    if ((i % 5) == 4) {
      draw_loc = {x: 0, y: draw_loc.y + total_width};
    } else {
      draw_loc = {x: draw_loc.x + total_width, y: draw_loc.y};
    }
  }
}
function drawBadCells ( cells ) { var context = c . getContext ( '2d' ) ; var canvas = c ; // from global. // Drawing bad cells var draw_loc = { x : 0 , y : 0 } ; for ( var i = 0 ; i < cells . length ; i ++ ) { var cell_info = cells [ i ] ; var cell = cell_info [ 0 ] ; var matched_entrances = cell_info [ 1 ] ; var matched_exits = cell_info [ 2 ] // Write information. context . fillStyle = 'black' ; context . fillText ( cell . toString ( ) , draw_loc . x + 5 , draw_loc . y + 10 ) context . fillText ( "ents:" + matched_entrances . length , draw_loc . x + 5 , draw_loc . y + 20 ) context . fillText ( "exts:" + matched_exits . length , draw_loc . x + 5 , draw_loc . y + 35 ) drawCell ( cell , canvas , { x : draw_loc . x + text_width , y : draw_loc . y } ) ; // Increment drawing location. if ( ( i % 5 ) == 4 ) { draw_loc = { x : 0 , y : draw_loc . y + total_width } ; } else { draw_loc = { x : draw_loc . x + total_width , y : draw_loc . y } ; } } }
Function for drawing the cells that were unmatched.
Function for drawing the cells that were unmatched .