Bug 1452503 - Fix the implicit and explicit lines drawn on the grid highlighter. r=pbro draft
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 27 Apr 2018 00:51:47 -0400
changeset 788927 0f74749d3d6c3253f657f5f3127963cad9055a74
parent 788926 2d34c4f04bc7e18e0e1d2c77581fcca07fd1e865
push id108104
push userbmo:gl@mozilla.com
push dateFri, 27 Apr 2018 04:52:25 +0000
reviewerspbro
bugs1452503
milestone61.0a1
Bug 1452503 - Fix the implicit and explicit lines drawn on the grid highlighter. r=pbro MozReview-Commit-ID: 6dWAWYbTna
devtools/server/actors/highlighters/css-grid.js
devtools/server/actors/highlighters/utils/canvas.js
--- a/devtools/server/actors/highlighters/css-grid.js
+++ b/devtools/server/actors/highlighters/css-grid.js
@@ -1377,17 +1377,16 @@ class CssGridHighlighter extends AutoRef
     let canvasY = Math.round(this._canvasPosition.y * devicePixelRatio);
 
     linePos = Math.round(linePos);
     startPos = Math.round(startPos);
     endPos = Math.round(endPos);
 
     this.ctx.save();
     this.ctx.setLineDash(GRID_LINES_PROPERTIES[lineType].lineDash);
-    this.ctx.beginPath();
     this.ctx.translate(offset - canvasX, offset - canvasY);
 
     let lineOptions = {
       matrix: this.currentMatrix
     };
 
     if (this.options.showInfiniteLines) {
       lineOptions.extendToBoundaries = [canvasX, canvasY, canvasX + CANVAS_SIZE,
--- a/devtools/server/actors/highlighters/utils/canvas.js
+++ b/devtools/server/actors/highlighters/utils/canvas.js
@@ -166,17 +166,16 @@ function drawLine(ctx, x1, y1, x2, y2, o
       y2 = options.extendToBoundaries[3];
       x2 = (p2[0] - p1[0]) * (y2 - p1[1]) / (p2[1] - p1[1]) + p1[0];
     }
   }
 
   ctx.beginPath();
   ctx.moveTo(Math.round(x1), Math.round(y1));
   ctx.lineTo(Math.round(x2), Math.round(y2));
-  ctx.closePath();
 }
 
 /**
  * Draws a rect to the context given and applies a transformation matrix if passed.
  * The coordinates are the start and end points of the rectangle's diagonal.
  *
  * @param  {CanvasRenderingContext2D} ctx
  *         The 2D canvas context.