From: Cheng Zhao Date: Tue, 31 Dec 2013 06:40:42 +0000 (+0800) Subject: Flip the y axis in CapturePage API, fixes #148. X-Git-Tag: v0.8.2~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cac397373193c1ec9211df684ebb917d1da4cacc;p=electron.git Flip the y axis in CapturePage API, fixes #148. --- diff --git a/browser/native_window.cc b/browser/native_window.cc index 2411464a..8aa0a266 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -213,8 +213,11 @@ base::ProcessHandle NativeWindow::GetRenderProcessHandle() { void NativeWindow::CapturePage(const gfx::Rect& rect, const CapturePageCallback& callback) { + gfx::Rect flipped_y_rect = rect; + flipped_y_rect.set_y(-rect.y()); + GetWebContents()->GetRenderViewHost()->CopyFromBackingStore( - rect, + flipped_y_rect, gfx::Size(), base::Bind(&NativeWindow::OnCapturePageDone, weak_factory_.GetWeakPtr(),