зеркало из https://github.com/mozilla/pjs.git
Fix event coordinate regression when views don't line up with widgets. b=308521 Patch from Eli Friedman <sharparrow1@yahoo.com>. r+sr=roc
This commit is contained in:
Родитель
cac5227aa6
Коммит
252c316b90
|
@ -490,16 +490,16 @@ nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext,
|
|||
nsIWidget* aWidget, nsIntPoint aPt,
|
||||
nsIView* aView)
|
||||
{
|
||||
nsPoint widgetToView;
|
||||
nsIView* baseView = nsIView::GetViewFor(aWidget);
|
||||
if (!baseView)
|
||||
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||
nsIWidget* wid = baseView->GetNearestWidget(&widgetToView);
|
||||
nsPoint viewToWidget;
|
||||
nsIWidget* wid = baseView->GetNearestWidget(&viewToWidget);
|
||||
NS_ASSERTION(aWidget == wid, "Clashing widgets");
|
||||
float pixelsToTwips = aPresContext->PixelsToTwips();
|
||||
nsPoint refPointTwips(NSIntPixelsToTwips(aPt.x, pixelsToTwips),
|
||||
NSIntPixelsToTwips(aPt.y, pixelsToTwips));
|
||||
return refPointTwips + widgetToView - aView->GetOffsetTo(baseView);
|
||||
return refPointTwips - viewToWidget - aView->GetOffsetTo(baseView);
|
||||
}
|
||||
|
||||
// Combine aNewBreakType with aOrigBreakType, but limit the break types
|
||||
|
|
Загрузка…
Ссылка в новой задаче