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

Unified Diff: Source/devtools/front_end/ResponsiveDesignView.js

Issue 312813002: DevTools: [Responsive design] shift-drag resize widget for more precise dragging (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove pseudodoc comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/ResizerWidget.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ResponsiveDesignView.js
diff --git a/Source/devtools/front_end/ResponsiveDesignView.js b/Source/devtools/front_end/ResponsiveDesignView.js
index b05e8c36f9604d10bd18f47b024f169930c7ee21..ba6ebf45cf625cbfe8505ea831a2f1a680f9c3ed 100644
--- a/Source/devtools/front_end/ResponsiveDesignView.js
+++ b/Source/devtools/front_end/ResponsiveDesignView.js
@@ -166,6 +166,7 @@ WebInspector.ResponsiveDesignView.prototype = {
_onResizeStart: function(event)
{
var available = this.availableDipSize();
+ this._slowPositionStart = null;
this._resizeStartSize = event.target.isVertical() ? (this._dipHeight || available.height) : (this._dipWidth || available.width);
},
@@ -174,8 +175,10 @@ WebInspector.ResponsiveDesignView.prototype = {
*/
_onResizeUpdate: function(event)
{
- var cssOffset = event.data.currentPosition - event.data.startPosition;
- var dipOffset = cssOffset * WebInspector.zoomManager.zoomFactor();
+ if (event.data.shiftKey !== !!this._slowPositionStart)
+ this._slowPositionStart = event.data.shiftKey ? event.data.currentPosition : null;
+ 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());
lushnikov 2014/06/04 09:15:42 added Math.round statement we've talked about.
var newSize = Math.max(this._resizeStartSize + dipOffset, 1);
var requested = new Size(this._dipWidth, this._dipHeight);
if (event.target.isVertical())
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/ResizerWidget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698