code: function updateGrid(gx, gy, gw, gh, info, item) {
        var occupied = info.occupied;
        var drawMask = settings.drawMask;
        var ctx;
        if (drawMask) {
          ctx = elements[0].getContext('2d');
          ctx.save();
          ctx.fillStyle = settings.maskColor;
        }
  
        var dimension;
        if (interactive) {
          var bounds = info.bounds;
          dimension = {
            x: (gx + bounds[3]) * g,
            y: (gy + bounds[0]) * g,
            w: (bounds[1] - bounds[3] + 1) * g,
            h: (bounds[2] - bounds[0] + 1) * g
          };
        }
  
        var i = occupied.length;
        while (i--) {
          var px = gx + occupied[i][0];
          var py = gy + occupied[i][1];
  
          if (px >= ngx || py >= ngy || px < 0 || py < 0) {
            continue;
          }
  
          fillGridAt(px, py, drawMask, dimension, item);
        }
  
        if (drawMask) {
          ctx.restore();
        }
      }
docs: /* Update the filling information of the given space with occupied points.
  Draw the mask on the canvas if necessary.