Chromium Code Reviews
DescriptionDevTools: 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
NOTRY=true
NOPRESUBMIT=true
Review-Url: https://codereview.chromium.org/2449763002
Cr-Commit-Position: refs/heads/master@{#427583}
(cherry picked from commit 2f5985ecef25664e1b6bba43b338683dd5d63c64)
Patch Set 1 #
Messages
Total messages: 8 (4 generated)
|
|||||||||||||||||||