• Andrew Xu's avatar
    [Multipaste] Fix image tiling when showing a small image · c9693c9a
    Andrew Xu authored
    In RoundedImageView, we expect to get the size of the stored image via
    GetPreferredSize(). However, RoundedImageView may have its preferred
    size. As a result, CalculatePreferredSize() overridden by
    RoundedImageView is never called. It makes the area to paint the image
    bigger than the size of the image. Meanwhile, the canvas function to
    paint the image uses tiling flag as default. It is why a small image
    is tiled.
    
    This CL uses GetImageSize() in replace of GetPreferredSize(). The side
    effect is handled. Add DCHECK to verify.
    
    Bug: 1139498
    Change-Id: Ia03c3366f22c8ce7d2c9326fd1097cab3e4ba563
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2499170
    Commit-Queue: Andrew Xu <andrewxu@chromium.org>
    Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
    Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#820972}
    c9693c9a
rounded_image_view.cc 3.76 KB