зеркало из https://github.com/electron/electron.git
No more need to flip rect for capturePage, fixes #589.
This commit is contained in:
Родитель
058d0bbe19
Коммит
cab546cbb7
|
@ -249,18 +249,10 @@ void NativeWindow::CapturePage(const gfx::Rect& rect,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::Rect flipped_y_rect = rect;
|
|
||||||
flipped_y_rect.set_y(-rect.y());
|
|
||||||
|
|
||||||
gfx::Size size;
|
|
||||||
if (flipped_y_rect.IsEmpty())
|
|
||||||
size = render_widget_host_view->GetViewBounds().size();
|
|
||||||
else
|
|
||||||
size = flipped_y_rect.size();
|
|
||||||
|
|
||||||
GetWebContents()->GetRenderViewHost()->CopyFromBackingStore(
|
GetWebContents()->GetRenderViewHost()->CopyFromBackingStore(
|
||||||
flipped_y_rect,
|
rect,
|
||||||
size,
|
rect.IsEmpty() ? render_widget_host_view->GetViewBounds().size() :
|
||||||
|
rect.size(),
|
||||||
base::Bind(&NativeWindow::OnCapturePageDone,
|
base::Bind(&NativeWindow::OnCapturePageDone,
|
||||||
weak_factory_.GetWeakPtr(),
|
weak_factory_.GetWeakPtr(),
|
||||||
callback),
|
callback),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче