Bug 1210632 - Move the pointer to (0,0) with the New Measure Tool r=pbro
authorShounak <shounak.bhandekar@gmail.com>
Sat, 30 Dec 2017 21:41:53 +0530
changeset 453044 193679c98b6c19f1801dee2fab75bd7005934a8a
parent 453043 48cb9676ec2c0041967861731d11920a0fa1680b
child 453045 d9340e521bc0dc572c85e2069bccb56980901ec0
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1210632
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1210632 - Move the pointer to (0,0) with the New Measure Tool r=pbro MozReview-Commit-ID: 7XhSGD1QbiA
devtools/server/actors/highlighters/measuring-tool.js
--- a/devtools/server/actors/highlighters/measuring-tool.js
+++ b/devtools/server/actors/highlighters/measuring-tool.js
@@ -514,18 +514,18 @@ MeasuringToolHighlighter.prototype = {
         break;
       case "mousemove":
         ({ scrollX, scrollY, innerWidth, innerHeight } = this.env.window);
         x = event.clientX + scrollX;
         y = event.clientY + scrollY;
 
         let { coords } = this;
 
-        x = Math.min(innerWidth + scrollX - 1, Math.max(0 + scrollX, x));
-        y = Math.min(innerHeight + scrollY, Math.max(1 + scrollY, y));
+        x = Math.min(innerWidth + scrollX, Math.max(scrollX, x));
+        y = Math.min(innerHeight + scrollY, Math.max(scrollY, y));
 
         this.setSize(x - coords.x, y - coords.y);
 
         let type = this._isDragging ? "size" : "position";
 
         this.showLabel(type);
         break;
       case "mouseleave":