From: Cheng Zhao Date: Thu, 21 Aug 2014 04:40:31 +0000 (+0800) Subject: No more need to flip rect for capturePage, fixes #589. X-Git-Tag: v0.16.0~22 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cab546cbb7fe1bdcbdb712f2aed05eec1467fb98;p=electron.git No more need to flip rect for capturePage, fixes #589. --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 0ec5f218..8391a608 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -249,18 +249,10 @@ void NativeWindow::CapturePage(const gfx::Rect& rect, 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( - flipped_y_rect, - size, + rect, + rect.IsEmpty() ? render_widget_host_view->GetViewBounds().size() : + rect.size(), base::Bind(&NativeWindow::OnCapturePageDone, weak_factory_.GetWeakPtr(), callback),