Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Add scroll handling in onDraw() function of AwContents Class in Android_... #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/org/chromium/android_webview/AwContents.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,12 @@ public void onDraw(Canvas canvas) {
return;
}
Rect clip = canvas.getClipBounds();
if (!nativeDrawSW(mNativeAwContents, canvas, clip.left, clip.top,
//Get Horizontal scroll offset
int x = mContentViewCore.getNativeScrollXForTest();
//Get vertifcal scroll offset
int y = mContentViewCore.getNativeScrollYForTest();
//Adjust pin point upon scroll offsets while drawing
if (!nativeDrawSW(mNativeAwContents, canvas, clip.left + x, clip.top + y,
clip.right - clip.left, clip.bottom - clip.top)) {
Log.w(TAG, "Native DrawSW failed; clearing to background color.");
int c = mContentViewCore.getBackgroundColor();
Expand Down