Bug 1507741 - take zoom and dpr into account when rendering justify-content; r=miker

Differential Revision: https://phabricator.services.mozilla.com/D13063

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Patrick Brosset 2018-11-29 09:51:01 +00:00
parent 2be51b0d48
commit b08c6ea272

View File

@ -682,6 +682,14 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
const containerBounds = containerQuad.getBounds(); const containerBounds = containerQuad.getBounds();
const { width: containerWidth, height: containerHeight } = containerBounds; const { width: containerWidth, height: containerHeight } = containerBounds;
const offset = (getDisplayPixelRatio(this.win) / 2) % 1;
const zoom = getCurrentZoom(this.win);
const canvasX = Math.round(this._canvasPosition.x * this.win.devicePixelRatio * zoom);
const canvasY = Math.round(this._canvasPosition.y * this.win.devicePixelRatio * zoom);
this.ctx.save();
this.ctx.translate(offset - canvasX, offset - canvasY);
for (const flexLine of this.flexData.lines) { for (const flexLine of this.flexData.lines) {
const { crossStart, crossSize } = flexLine; const { crossStart, crossSize } = flexLine;
let mainStart = 0; let mainStart = 0;
@ -744,6 +752,8 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
break; break;
} }
} }
this.ctx.restore();
} }
_update() { _update() {