PopupWidget is now correctly positioned in hidpi mode.

This commit is contained in:
Stephen Anthony 2019-05-11 18:17:42 -02:30
parent e7759048ca
commit ef93ecfbd6
1 changed files with 3 additions and 2 deletions

View File

@ -122,8 +122,9 @@ void PopUpWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
const Common::Rect& image = instance().frameBuffer().imageRect(); const Common::Rect& image = instance().frameBuffer().imageRect();
const Common::Rect& srect = dialog().surface().dstRect(); const Common::Rect& srect = dialog().surface().dstRect();
uInt32 tx = srect.x(), ty = srect.y(); uInt32 tx = srect.x(), ty = srect.y();
tx += getAbsX() + _labelWidth - image.x(); uInt32 scale = instance().frameBuffer().hidpiScaleFactor();
ty += getAbsY() + getHeight() - image.y(); tx += scale * (getAbsX() + _labelWidth) - image.x();
ty += scale * (getAbsY() + getHeight()) - image.y();
myMenu->show(tx, ty, myMenu->getSelected()); myMenu->show(tx, ty, myMenu->getSelected());
} }
} }