mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 563878. Part 9. Remove nsIView::GetScreenPosition because it is unused. r=mats
This commit is contained in:
parent
14a8952bb9
commit
66ff344afd
@ -187,13 +187,6 @@ public:
|
||||
*/
|
||||
nsPoint GetOffsetTo(const nsIView* aOther) const;
|
||||
|
||||
/**
|
||||
* Get the screen position of the view.
|
||||
* @return the pixel position of the top-left of the view in screen
|
||||
* coordinates.
|
||||
*/
|
||||
nsIntPoint GetScreenPosition() const;
|
||||
|
||||
/**
|
||||
* Called to query the visibility state of a view.
|
||||
* @result current visibility state
|
||||
|
@ -932,25 +932,6 @@ nsPoint nsIView::GetOffsetTo(const nsIView* aOther) const
|
||||
return offset;
|
||||
}
|
||||
|
||||
nsIntPoint nsIView::GetScreenPosition() const
|
||||
{
|
||||
nsIntPoint screenPoint(0,0);
|
||||
nsPoint toWidgetOffset(0,0);
|
||||
nsIWidget* widget = GetNearestWidget(&toWidgetOffset);
|
||||
if (widget) {
|
||||
nsCOMPtr<nsIDeviceContext> dx;
|
||||
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
|
||||
PRInt32 p2a = dx->AppUnitsPerDevPixel();
|
||||
nsIntPoint ourPoint(NSAppUnitsToIntPixels(toWidgetOffset.x, p2a),
|
||||
NSAppUnitsToIntPixels(toWidgetOffset.y, p2a));
|
||||
// WidgetToScreenOffset is at the origin of the client area of
|
||||
// the widget.
|
||||
screenPoint = ourPoint + widget->WidgetToScreenOffset();
|
||||
}
|
||||
|
||||
return screenPoint;
|
||||
}
|
||||
|
||||
nsIWidget* nsIView::GetNearestWidget(nsPoint* aOffset) const
|
||||
{
|
||||
// aOffset is based on the view's position, which ignores any chrome on
|
||||
|
Loading…
Reference in New Issue
Block a user