Bug 1452503 - Remove closePath call to fix the implicit and explicit lines drawn on the grid highlighter. r=jdescottes
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 27 Apr 2018 10:14:46 -0400
changeset 472133 74a88bd1be7154d5a375c26b7c27370ad89c7d6d
parent 472132 bba12a996009ac1727a0251fc4689027289848bc
child 472134 3e459e1186feff716668d9a8351376aebfc052b1
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1452503
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452503 - Remove closePath call to fix the implicit and explicit lines drawn on the grid highlighter. r=jdescottes
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.