mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 296491. Mouse event synthesis needs to account for cases where the view origin is not at the origin of its widget. r+sr=dbaron,a=bsmedberg
This commit is contained in:
parent
6915b726de
commit
802e2cda75
@ -2162,7 +2162,9 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
|
||||
nsPoint rootOffset(0, 0);
|
||||
for (nsView *v = baseView; v != mRootView; v = v->GetParent())
|
||||
v->ConvertToParentCoords(&rootOffset.x, &rootOffset.y);
|
||||
|
||||
// aEvent->point is relative to the widget, i.e. the view top-left,
|
||||
// so we need to add the offset to the view origin
|
||||
rootOffset += baseView->GetDimensions().TopLeft();
|
||||
mMouseLocation.MoveTo(NSTwipsToIntPixels(rootOffset.x, t2p) +
|
||||
aEvent->point.x,
|
||||
NSTwipsToIntPixels(rootOffset.y, t2p) +
|
||||
|
Loading…
Reference in New Issue
Block a user