Commit c72172a8 authored by Eric Seckler's avatar Eric Seckler Committed by Commit Bot

[devtools] Round view size when captureScreenshot clip is specified.

Bug: 
Change-Id: Idca8b4471422732fdb854ecc29605d27a09b8c46
Reviewed-on: https://chromium-review.googlesource.com/570422Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486486}
parent 0b558c19
......@@ -394,9 +394,10 @@ void PageHandler::CaptureScreenshot(
emulation_handler_->SetDeviceEmulationParams(modified_params);
if (clip.isJust()) {
widget_host->GetView()->SetSize(gfx::ScaleToCeiledSize(
gfx::Size(clip.fromJust()->GetWidth(), clip.fromJust()->GetHeight()),
dpfactor * clip.fromJust()->GetScale()));
double scale = dpfactor * clip.fromJust()->GetScale();
widget_host->GetView()->SetSize(
gfx::Size(gfx::ToRoundedInt(clip.fromJust()->GetWidth() * scale),
gfx::ToRoundedInt(clip.fromJust()->GetHeight() * scale)));
} else {
widget_host->GetView()->SetSize(
gfx::ScaleToFlooredSize(emulated_view_size, dpfactor));
......
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