Bug 1315667 - Fix resizing inspector sidebar when zooming. r=Honza, a=jcristau
authorSébastien Blin <amarok@enconn.fr>
Tue, 29 Nov 2016 07:49:00 -0500
changeset 353620 db111a9521579272031cf3b95b62e362a4ba7528
parent 353619 7f15fe457dd3f77475384f55f3e8b41739e85b51
child 353621 2ae2be9972dac2ff7dde5c633a248fe5d0b799bf
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza, jcristau
bugs1315667
milestone52.0a2
Bug 1315667 - Fix resizing inspector sidebar when zooming. r=Honza, a=jcristau
devtools/client/shared/components/splitter/split-box.js
--- a/devtools/client/shared/components/splitter/split-box.js
+++ b/devtools/client/shared/components/splitter/split-box.js
@@ -92,36 +92,37 @@ const SplitBox = React.createClass({
    * the splitter box.
    */
   onMove(x, y) {
     const node = ReactDOM.findDOMNode(this);
     const doc = node.ownerDocument;
     const win = doc.defaultView;
 
     let size;
+    let ratio = win.devicePixelRatio || 1;
     let { endPanelControl } = this.props;
 
     if (this.state.vert) {
       // Switch the control flag in case of RTL. Note that RTL
       // has impact on vertical splitter only.
       let dir = win.getComputedStyle(doc.documentElement).direction;
       if (dir == "rtl") {
         endPanelControl = !endPanelControl;
       }
 
-      let innerOffset = x - win.mozInnerScreenX;
+      let innerOffset = (x / ratio) - win.mozInnerScreenX;
       size = endPanelControl ?
         (node.offsetLeft + node.offsetWidth) - innerOffset :
         innerOffset - node.offsetLeft;
 
       this.setState({
         width: size
       });
     } else {
-      let innerOffset = y - win.mozInnerScreenY;
+      let innerOffset = (y / ratio) - win.mozInnerScreenY;
       size = endPanelControl ?
         (node.offsetTop + node.offsetHeight) - innerOffset :
         innerOffset - node.offsetTop;
 
       this.setState({
         height: size
       });
     }