Bug 243757. Handle cases where this view manager's root view is not an ancestor of the view grabbing the mouse. r+sr=bzbarsky

This commit is contained in:
roc+%cs.cmu.edu 2004-05-22 19:55:01 +00:00
Родитель 7f6d9d8c2c
Коммит 2e474e6454
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -1917,18 +1917,17 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
nsView *parent;
parent = baseView;
while (mRootView != parent) {
while (parent) {
parent->ConvertToParentCoords(&offset.x, &offset.y);
parent = parent->GetParent();
}
//Subtract back offset from root of view
parent = view;
while (mRootView != parent) {
while (parent) {
parent->ConvertFromParentCoords(&offset.x, &offset.y);
parent = parent->GetParent();
}
}
//Dispatch the event