• Eliot Courtney's avatar
    [Notifications] Avoid bad scaling from floating point truncation. · 0880dc1e
    Eliot Courtney authored
    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: default avatarYoshiki Iguchi <yoshiki@chromium.org>
    Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#496605}
    0880dc1e
arc_notification_content_view.cc 20.7 KB