[Multipaste] Fix image tiling when showing a small image
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:Alex Newcomer <newcomer@chromium.org> Reviewed-by:
Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/master@{#820972}
Showing
Please register or sign in to comment