Commit f177c6bd authored by dgozman@chromium.org's avatar dgozman@chromium.org

[DevTools] Limit responsive design resize request to width/height only.

Before, if we had not enough space and clipped the page height,
resizing width will also reset height to the clipped size.

BUG=none

Review URL: https://codereview.chromium.org/321513004

git-svn-id: svn://svn.chromium.org/blink/trunk@175687 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 46541cdc
......@@ -174,7 +174,7 @@ WebInspector.ResponsiveDesignView.prototype = {
var cssOffset = this._slowPositionStart ? (event.data.currentPosition - this._slowPositionStart) / 10 + this._slowPositionStart - event.data.startPosition : event.data.currentPosition - event.data.startPosition;
var dipOffset = Math.round(cssOffset * WebInspector.zoomManager.zoomFactor());
var newSize = Math.max(this._resizeStartSize + dipOffset, 1);
var requested = new Size(this._dipWidth, this._dipHeight);
var requested = {};
if (event.target.isVertical())
requested.height = newSize;
else
......
......@@ -601,11 +601,16 @@ WebInspector.OverridesSupport.prototype = {
_onPageResizerResizeRequested: function(event)
{
var size = /** @type {!Size} */ (event.data);
if (size.width !== this.settings.deviceWidth.get())
this.settings.deviceWidth.set(size.width);
if (size.height !== this.settings.deviceHeight.get())
this.settings.deviceHeight.set(size.height);
if (typeof event.data.width !== "undefined") {
var width = /** @type {number} */ (event.data.width);
if (width !== this.settings.deviceWidth.get())
this.settings.deviceWidth.set(width);
}
if (typeof event.data.height !== "undefined") {
var height = /** @type {number} */ (event.data.height);
if (height !== this.settings.deviceHeight.get())
this.settings.deviceHeight.set(height);
}
},
_deviceMetricsChanged: function()
......
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