зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1468953: Use node bounds in viewport instead of offsets from offsetParent. r=jdescottes
MozReview-Commit-ID: nqMLetevCZ --HG-- extra : rebase_source : 8ca955be72b36a7554024103ceede82bce0b5076
This commit is contained in:
Родитель
63dbf9d6f7
Коммит
f24d951078
|
@ -166,6 +166,7 @@ class SplitBox extends Component {
|
|||
*/
|
||||
onMove(x, y) {
|
||||
const node = ReactDOM.findDOMNode(this);
|
||||
const nodeBounds = node.getBoundingClientRect();
|
||||
|
||||
let size;
|
||||
let { endPanelControl, vert } = this.state;
|
||||
|
@ -182,16 +183,16 @@ class SplitBox extends Component {
|
|||
}
|
||||
|
||||
size = endPanelControl ?
|
||||
(node.offsetLeft + node.offsetWidth) - x :
|
||||
x - node.offsetLeft;
|
||||
(nodeBounds.left + nodeBounds.width) - x :
|
||||
x - nodeBounds.left;
|
||||
|
||||
this.setState({
|
||||
width: size
|
||||
});
|
||||
} else {
|
||||
size = endPanelControl ?
|
||||
(node.offsetTop + node.offsetHeight) - y :
|
||||
y - node.offsetTop;
|
||||
(nodeBounds.top + nodeBounds.height) - y :
|
||||
y - nodeBounds.top;
|
||||
|
||||
this.setState({
|
||||
height: size
|
||||
|
|
Загрузка…
Ссылка в новой задаче