Commit e3ca4598 authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

[Autofill Assistant] Remove unnecessary round() from ElementPositionGetter.

Before this change, ElementPositionGetter would round each coordinate it
got before computing the center, then rounding it. With this change,
only the center is rounded. This was puzzling.

This change is expected to have no effect, as all coordinates should be
integer values to begin with. It's just a cleanup.

Change-Id: Ib0ac75f6e08d825f1521e32325c87672eb9f9d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521734Reviewed-by: default avatarClemens Arbesser <arbesser@google.com>
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824839}
parent d7c028af
......@@ -83,10 +83,8 @@ void ElementPositionGetter::OnGetBoxModelForStableCheck(
// Return the center of the element.
const std::vector<double>* content_box = result->GetModel()->GetContent();
DCHECK_EQ(content_box->size(), 8u);
int new_point_x =
round((round((*content_box)[0]) + round((*content_box)[2])) * 0.5);
int new_point_y =
round((round((*content_box)[3]) + round((*content_box)[5])) * 0.5);
int new_point_x = round(((*content_box)[0] + (*content_box)[2]) * 0.5);
int new_point_y = round(((*content_box)[3] + (*content_box)[5]) * 0.5);
// Wait for at least three rounds (~600ms = 3*check_interval_) for visual
// state update callback since it might take longer time to return or never
......
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