mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Clarify expectations for CefRenderHandler::GetViewRect (issue #1910)
This commit is contained in:
@@ -1348,13 +1348,18 @@ bool BrowserWindowOsrMac::GetRootScreenRect(CefRefPtr<CefBrowser> browser,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BrowserWindowOsrMac::GetViewRect(CefRefPtr<CefBrowser> browser,
|
||||
void BrowserWindowOsrMac::GetViewRect(CefRefPtr<CefBrowser> browser,
|
||||
CefRect& rect) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
REQUIRE_MAIN_THREAD();
|
||||
|
||||
if (!nsview_)
|
||||
return false;
|
||||
rect.x = rect.y = 0;
|
||||
|
||||
if (!nsview_) {
|
||||
// Never return an empty rectangle.
|
||||
rect.width = rect.height = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
const float device_scale_factor = [GLView(nsview_) getDeviceScaleFactor];
|
||||
|
||||
@@ -1365,11 +1370,8 @@ bool BrowserWindowOsrMac::GetViewRect(CefRefPtr<CefBrowser> browser,
|
||||
bounds = [GLView(nsview_) convertRectToBackingInternal:bounds];
|
||||
|
||||
// Convert to browser view coordinates.
|
||||
rect.x = rect.y = 0;
|
||||
rect.width = DeviceToLogical(bounds.size.width, device_scale_factor);
|
||||
rect.height = DeviceToLogical(bounds.size.height, device_scale_factor);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BrowserWindowOsrMac::GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
||||
|
Reference in New Issue
Block a user