Commit 6f9ce329 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

view-android: use std::round() rather than floor

Using floor means the top/bottom layer and the content may get 1-pixel
out of sync. Using round() helps avoid this.

BUG=none
TEST=none

Change-Id: If5aa3445dbd0293c0f3e3ccbe7ad34bce4bbb62b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888130Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710476}
parent 8844f003
......@@ -423,8 +423,9 @@ void ViewAndroid::OnTopControlsChanged(float top_controls_offset,
if (delegate.is_null())
return;
JNIEnv* env = base::android::AttachCurrentThread();
Java_ViewAndroidDelegate_onTopControlsChanged(
env, delegate, top_controls_offset, top_content_offset);
Java_ViewAndroidDelegate_onTopControlsChanged(env, delegate,
std::round(top_controls_offset),
std::round(top_content_offset));
}
void ViewAndroid::OnBottomControlsChanged(float bottom_controls_offset,
......@@ -434,7 +435,8 @@ void ViewAndroid::OnBottomControlsChanged(float bottom_controls_offset,
return;
JNIEnv* env = base::android::AttachCurrentThread();
Java_ViewAndroidDelegate_onBottomControlsChanged(
env, delegate, bottom_controls_offset, bottom_content_offset);
env, delegate, std::round(bottom_controls_offset),
std::round(bottom_content_offset));
}
int ViewAndroid::GetViewportInsetBottom() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment