[Notifications] Avoid bad scaling from floating point truncation.
Suppose we have a notification with surface size 720x161. In |UpdatePreferredSize|, we make sure the notification is of width kNotificationWidth (360). While scaling, 161/2 is truncated to 80. Later, in |Layout|, we use |contents_size| which holds the truncated 80 to compute the transform. This leads to the notification eventually being displayed as 720x160. Instead, compute the scale factor based on the surface width and kNotificationWidth. BUG=754369 Change-Id: Ib2025bf7aac9d096085e0a641c20c6cc84689503 Reviewed-on: https://chromium-review.googlesource.com/625605Reviewed-by:Yoshiki Iguchi <yoshiki@chromium.org> Commit-Queue: Eliot Courtney <edcourtney@chromium.org> Cr-Commit-Position: refs/heads/master@{#496605}
Showing
Please register or sign in to comment