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
Родитель 2be51b0d48
Коммит b08c6ea272
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -682,6 +682,14 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
const containerBounds = containerQuad.getBounds();
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) {
const { crossStart, crossSize } = flexLine;
let mainStart = 0;
@ -744,6 +752,8 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
break;
}
}
this.ctx.restore();
}
_update() {