Bug 290553. Make the canvas frame translate event coordinates correctly. r+sr=bzbarsky,a=brendan

This commit is contained in:
roc+%cs.cmu.edu 2005-04-18 20:41:47 +00:00
Родитель 825c57b68b
Коммит c5685f90dc
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -590,10 +590,19 @@ CanvasFrame::HandleEvent(nsPresContext* aPresContext,
//canvas frame needs to pass mouse events to its area frame so that mouse movement
//and selection code will work properly. this will still have the necessary effects
//that would have happened if nsFrame::HandleEvent was called.
if (firstChild)
if (firstChild) {
nsIView* eventView;
nsIView* newEventView;
nsPoint pt1, pt2;
GetOffsetFromView(pt1, &eventView);
firstChild->GetOffsetFromView(pt2, &newEventView);
nsPoint offset = eventView->GetOffsetTo(newEventView);
aEvent->point += offset;
firstChild->HandleEvent(aPresContext, aEvent, aEventStatus);
else
aEvent->point -= offset;
} else {
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
}
return NS_OK;