Bug 1452503 - Fix the implicit and explicit lines drawn on the grid highlighter. r=pbro
MozReview-Commit-ID: 6dWAWYbTna
--- 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.