зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
10da3617fb
Коммит
2b9edf597c
|
@ -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) +
|
||||
|
|
Загрузка…
Ссылка в новой задаче