зеркало из https://github.com/mozilla/pjs.git
Bug 290553. Make the canvas frame translate event coordinates correctly. r+sr=bzbarsky,a=brendan
This commit is contained in:
Родитель
825c57b68b
Коммит
c5685f90dc
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче