Commit ba204c6c authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

CrOS AppList: Fix notification badge scaling jank

Using float instead of int for calculating the center point of the
notification badge allows for better positioning when the icon is
scaled up and down on long press.

Bug: 1131076
Change-Id: Ic5d41c1c94c941a984f34b3a41344160b10fceff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559312Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831079}
parent 5422dfb0
......@@ -171,11 +171,11 @@ class AppListItemView::AppNotificationIndicatorView : public views::View {
DCHECK_EQ(width(), height());
const float dsf = canvas->UndoDeviceScaleFactor();
int radius = width() * kNotificationIndicatorWidthRatio / 2.0f;
int padding = width() * kNotificationIndicatorPaddingRatio;
float radius = width() * kNotificationIndicatorWidthRatio / 2.0f;
float padding = width() * kNotificationIndicatorPaddingRatio;
int center_x = width() - radius - padding;
int center_y = padding + radius;
float center_x = width() - radius - padding;
float center_y = padding + radius;
gfx::PointF center = gfx::PointF(center_x, center_y);
center.Scale(dsf);
......
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