Bug 1202176, adjust coordinates from device to css pixels when drag popup moves, r=tn

This commit is contained in:
Neil Deakin
2015-09-14 15:18:44 -04:00
parent 9bddd7635c
commit 64d0386975

View File

@@ -431,7 +431,10 @@ nsBaseDragService::DragMoved(int32_t aX, int32_t aY)
if (mDragPopup) {
nsIFrame* frame = mDragPopup->GetPrimaryFrame();
if (frame && frame->GetType() == nsGkAtoms::menuPopupFrame) {
(static_cast<nsMenuPopupFrame *>(frame))->MoveTo(aX - mImageX, aY - mImageY, true);
nsPresContext* presContext = frame->PresContext();
int32_t x = presContext->DevPixelsToIntCSSPixels(aX - mImageX);
int32_t y = presContext->DevPixelsToIntCSSPixels(aY - mImageY);
(static_cast<nsMenuPopupFrame *>(frame))->MoveTo(x, y, true);
}
}