Bug 1760184 [Wayland] Apply correction for negative anchor width r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D141433
This commit is contained in:
stransky 2022-03-22 20:51:22 +00:00
Родитель 83f95f6c5d
Коммит 02c1890996
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -2255,13 +2255,13 @@ nsWindow::WaylandPopupGetPositionFromLayout() {
anchorRectAppUnits.Inflate(popupMargin.mAnchorMargin);
LOG(" after margins %s\n", ToString(anchorRectAppUnits).c_str());
nscoord auPerDev = popupFrame->PresContext()->AppUnitsPerDevPixel();
anchorRect = LayoutDeviceIntRect::FromAppUnitsToNearest(anchorRectAppUnits,
auPerDev);
if (anchorRect.width < 0) {
auto w = -anchorRect.width;
anchorRect.width += w + 1;
anchorRect.x += w;
}
anchorRect = LayoutDeviceIntRect::FromAppUnitsToNearest(anchorRectAppUnits,
auPerDev);
LOG(" final %s\n", ToString(anchorRect).c_str());
}