OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {WebInspector.Object} | 9 * @extends {WebInspector.Object} |
10 * @param {!Element} element | 10 * @param {!Element} element |
(...skipping 16 matching lines...) Expand all Loading... |
27 WebInspector.TransformController.Events = { | 27 WebInspector.TransformController.Events = { |
28 TransformChanged: "TransformChanged" | 28 TransformChanged: "TransformChanged" |
29 } | 29 } |
30 | 30 |
31 WebInspector.TransformController.prototype = { | 31 WebInspector.TransformController.prototype = { |
32 /** | 32 /** |
33 * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, func
tion(?Event=))} registerShortcutDelegate | 33 * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, func
tion(?Event=))} registerShortcutDelegate |
34 */ | 34 */ |
35 registerShortcuts: function(registerShortcutDelegate) | 35 registerShortcuts: function(registerShortcutDelegate) |
36 { | 36 { |
37 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ResetView, this._resetAndNotify.bind(this)); | 37 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ResetView, this.resetAndNotify.bind(this)); |
38 var zoomFactor = 1.1; | 38 var zoomFactor = 1.1; |
39 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomIn, this._onKeyboardZoom.bind(this, zoomFactor)); | 39 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomIn, this._onKeyboardZoom.bind(this, zoomFactor)); |
40 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomOut, this._onKeyboardZoom.bind(this, 1 / zoomFactor)); | 40 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomOut, this._onKeyboardZoom.bind(this, 1 / zoomFactor)); |
41 var panDistanceInPixels = 6; | 41 var panDistanceInPixels = 6; |
42 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanUp, this._onPan.bind(this, 0, -panDistanceInPixels)); | 42 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanUp, this._onPan.bind(this, 0, -panDistanceInPixels)); |
43 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanDown, this._onPan.bind(this, 0, panDistanceInPixels)); | 43 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanDown, this._onPan.bind(this, 0, panDistanceInPixels)); |
44 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanLeft, this._onPan.bind(this, -panDistanceInPixels, 0)); | 44 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanLeft, this._onPan.bind(this, -panDistanceInPixels, 0)); |
45 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanRight, this._onPan.bind(this, panDistanceInPixels, 0)); | 45 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanRight, this._onPan.bind(this, panDistanceInPixels, 0)); |
46 var rotateDegrees = 5; | 46 var rotateDegrees = 5; |
47 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.RotateCWX, this._onKeyboardRotate.bind(this, rotateDegrees, 0)); | 47 registerShortcutDelegate(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.RotateCWX, this._onKeyboardRotate.bind(this, rotateDegrees, 0)); |
(...skipping 12 matching lines...) Expand all Loading... |
60 this._scale = 1; | 60 this._scale = 1; |
61 this._offsetX = 0; | 61 this._offsetX = 0; |
62 this._offsetY = 0; | 62 this._offsetY = 0; |
63 this._rotateX = 0; | 63 this._rotateX = 0; |
64 this._rotateY = 0; | 64 this._rotateY = 0; |
65 }, | 65 }, |
66 | 66 |
67 /** | 67 /** |
68 * @param {?Event=} event | 68 * @param {?Event=} event |
69 */ | 69 */ |
70 _resetAndNotify: function(event) | 70 resetAndNotify: function(event) |
71 { | 71 { |
72 this._reset(); | 72 this._reset(); |
73 this._postChangeEvent(); | 73 this._postChangeEvent(); |
74 if (event) | 74 if (event) |
75 event.preventDefault(); | 75 event.preventDefault(); |
76 }, | 76 }, |
77 | 77 |
78 /** | 78 /** |
79 * @return {number} | 79 * @return {number} |
80 */ | 80 */ |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 */ | 236 */ |
237 _onMouseUp: function(event) | 237 _onMouseUp: function(event) |
238 { | 238 { |
239 if (event.which !== 1) | 239 if (event.which !== 1) |
240 return; | 240 return; |
241 this._resetReferencePoint(); | 241 this._resetReferencePoint(); |
242 }, | 242 }, |
243 | 243 |
244 __proto__: WebInspector.Object.prototype | 244 __proto__: WebInspector.Object.prototype |
245 } | 245 } |
OLD | NEW |