зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1328895 - use clientX/Y instead of screenX/Y when moving devtools splitter;r=Honza
MozReview-Commit-ID: 54bqux7tE5f --HG-- extra : rebase_source : d6863831aef393be9fdf2a08a29a444aef5d75ed
This commit is contained in:
Родитель
5261463586
Коммит
e7ee70fc24
|
@ -29,9 +29,9 @@ const Draggable = React.createClass({
|
|||
|
||||
onMove(ev) {
|
||||
ev.preventDefault();
|
||||
// Use screen coordinates so, moving mouse over iframes
|
||||
// Use viewport coordinates so, moving mouse over iframes
|
||||
// doesn't mangle (relative) coordinates.
|
||||
this.props.onMove(ev.screenX, ev.screenY);
|
||||
this.props.onMove(ev.clientX, ev.clientY);
|
||||
},
|
||||
|
||||
onUp(ev) {
|
||||
|
|
|
@ -103,7 +103,6 @@ const SplitBox = React.createClass({
|
|||
const win = doc.defaultView;
|
||||
|
||||
let size;
|
||||
let ratio = win.devicePixelRatio || 1;
|
||||
let { endPanelControl } = this.props;
|
||||
|
||||
if (this.state.vert) {
|
||||
|
@ -114,19 +113,17 @@ const SplitBox = React.createClass({
|
|||
endPanelControl = !endPanelControl;
|
||||
}
|
||||
|
||||
let innerOffset = (x / ratio) - win.mozInnerScreenX;
|
||||
size = endPanelControl ?
|
||||
(node.offsetLeft + node.offsetWidth) - innerOffset :
|
||||
innerOffset - node.offsetLeft;
|
||||
(node.offsetLeft + node.offsetWidth) - x :
|
||||
x - node.offsetLeft;
|
||||
|
||||
this.setState({
|
||||
width: size
|
||||
});
|
||||
} else {
|
||||
let innerOffset = (y / ratio) - win.mozInnerScreenY;
|
||||
size = endPanelControl ?
|
||||
(node.offsetTop + node.offsetHeight) - innerOffset :
|
||||
innerOffset - node.offsetTop;
|
||||
(node.offsetTop + node.offsetHeight) - y :
|
||||
y - node.offsetTop;
|
||||
|
||||
this.setState({
|
||||
height: size
|
||||
|
|
Загрузка…
Ссылка в новой задаче