зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1152585 - Implement GetClientOffset in nsChildView to fix child offset calculation when drawInTitlebar=false r=mstange
This commit is contained in:
Родитель
67e80ebb07
Коммит
f8adab0ca9
|
@ -543,6 +543,8 @@ public:
|
|||
|
||||
bool IsPluginFocused() { return mPluginFocused; }
|
||||
|
||||
virtual nsIntPoint GetClientOffset() override;
|
||||
|
||||
protected:
|
||||
virtual ~nsChildView();
|
||||
|
||||
|
|
|
@ -1485,6 +1485,17 @@ void nsChildView::ReportSizeEvent()
|
|||
|
||||
#pragma mark -
|
||||
|
||||
nsIntPoint nsChildView::GetClientOffset()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
||||
NSPoint origin = [mView convertPoint:NSMakePoint(0, 0) toView:nil];
|
||||
origin.y = [[mView window] frame].size.height - origin.y;
|
||||
return CocoaPointsToDevPixels(origin);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0, 0));
|
||||
}
|
||||
|
||||
// Return the offset between this child view and the screen.
|
||||
// @return -- widget origin in device-pixel coords
|
||||
LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset()
|
||||
|
|
Загрузка…
Ссылка в новой задаче