Bug 1202176, adjust coordinates from device to css pixels when drag popup moves, r=tn
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user