Commit cb6b7edb authored by Andrew Xu's avatar Andrew Xu Committed by Chromium LUCI CQ

[Multipaste] Adjust scaling of the copied img

This CL allows a copied image to be shrunk in order to fill the
contents area of a clipboard history menu item.

Bug: 1165286
Change-Id: I4ce2ce415021b04db4b5de67815791e5e052103f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627434Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Auto-Submit: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843133}
parent 966f31b6
...@@ -261,11 +261,7 @@ class ClipboardHistoryBitmapItemView::BitmapContentsView ...@@ -261,11 +261,7 @@ class ClipboardHistoryBitmapItemView::BitmapContentsView
float scaling_up_ratio = 0.f; float scaling_up_ratio = 0.f;
switch (container_->data_format_) { switch (container_->data_format_) {
case ui::ClipboardInternalFormat::kBitmap: { case ui::ClipboardInternalFormat::kBitmap: {
if (width_ratio >= 1.f && height_ratio >= 1.f) scaling_up_ratio = std::fmin(width_ratio, height_ratio);
scaling_up_ratio = 1.f;
else
scaling_up_ratio = std::fmin(width_ratio, height_ratio);
DCHECK_LE(scaling_up_ratio, 1.f);
break; break;
} }
case ui::ClipboardInternalFormat::kHtml: { case ui::ClipboardInternalFormat::kHtml: {
......
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