Flip the y axis in CapturePage API, fixes #148.
This commit is contained in:
parent
19a35b58f0
commit
cac3973731
1 changed files with 4 additions and 1 deletions
|
@ -213,8 +213,11 @@ base::ProcessHandle NativeWindow::GetRenderProcessHandle() {
|
||||||
|
|
||||||
void NativeWindow::CapturePage(const gfx::Rect& rect,
|
void NativeWindow::CapturePage(const gfx::Rect& rect,
|
||||||
const CapturePageCallback& callback) {
|
const CapturePageCallback& callback) {
|
||||||
|
gfx::Rect flipped_y_rect = rect;
|
||||||
|
flipped_y_rect.set_y(-rect.y());
|
||||||
|
|
||||||
GetWebContents()->GetRenderViewHost()->CopyFromBackingStore(
|
GetWebContents()->GetRenderViewHost()->CopyFromBackingStore(
|
||||||
rect,
|
flipped_y_rect,
|
||||||
gfx::Size(),
|
gfx::Size(),
|
||||||
base::Bind(&NativeWindow::OnCapturePageDone,
|
base::Bind(&NativeWindow::OnCapturePageDone,
|
||||||
weak_factory_.GetWeakPtr(),
|
weak_factory_.GetWeakPtr(),
|
||||||
|
|
Loading…
Reference in a new issue