Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Issue 2449763002: DevTools: fix rounding of scale in device mode (Closed)

Created:
4 years, 1 month ago by luoe
Modified:
4 years, 1 month ago
Reviewers:
dgozman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, pfeldman, kozyatinskiy+blink_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: fix rounding of scale in device mode While resizing the DevTools viewport to be smaller than the emulated device's screen size in responsive mode, _calculateAndEmulate() clamps the emulated screen size to preferredScaledWidth/Height(). The condition to do so checks whether the screen's dimensions are greater than the preferred-scaled dimensions. The sharp scale calculator in calculateFitScale() would find a scale nearby the precise value that would result in integer screen sizes. However, it was possible for the sharp scale to be greater than the actual scale, which resulted in a smaller preferredScaledWidth/Height() than was available. This edge case triggers the clamping condition, which led to inaccurate widths/heights that differed from user input. BUG=651123 Committed: https://crrev.com/2f5985ecef25664e1b6bba43b338683dd5d63c64 Cr-Commit-Position: refs/heads/master@{#427583}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (10 generated)
luoe
These changes should be accounted for in tests in a separate CL: https://codereview.chromium.org/2446113004
4 years, 1 month ago (2016-10-25 18:52:36 UTC) #5
dgozman
Nice stuff! lgtm
4 years, 1 month ago (2016-10-26 01:55:55 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2449763002/1
4 years, 1 month ago (2016-10-26 03:05:27 UTC) #10
commit-bot: I haz the power
Failed to apply the patch. On branch working_branch Your branch is up-to-date with 'origin/refs/pending/heads/master'. nothing ...
4 years, 1 month ago (2016-10-26 04:04:21 UTC) #13
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 04:05:24 UTC) #15
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/2f5985ecef25664e1b6bba43b338683dd5d63c64
Cr-Commit-Position: refs/heads/master@{#427583}

Powered by Google App Engine
This is Rietveld 408576698