Bug 1450685 - Ensure correct cursor is shown when rotating a polygon. r=pbro
authorRazvan Caliman <rcaliman@mozilla.com>
Thu, 12 Apr 2018 17:10:05 +0200
changeset 415989 0e1f60508407f11848916a8b881cad85da70b414
parent 415988 4421b373b86a8cb14b4f92dc5c7735f92925f9b1
child 415990 61ef0409797103377777cdd32f6c6d1b1470b748
push id63342
push userrcaliman@mozilla.com
push dateFri, 27 Apr 2018 09:30:56 +0000
treeherderautoland@0e1f60508407 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1450685
milestone61.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 1450685 - Ensure correct cursor is shown when rotating a polygon. r=pbro MozReview-Commit-ID: Jv6uD6T0HmP
devtools/server/actors/highlighters/shapes.js
--- a/devtools/server/actors/highlighters/shapes.js
+++ b/devtools/server/actors/highlighters/shapes.js
@@ -520,17 +520,17 @@ class ShapesHighlighter extends AutoRefr
 
         // Calculate constraints for a virtual viewport which ensures that a dragged
         // marker remains visible even at the edges of the actual viewport.
         this.setViewport(BASE_MARKER_SIZE);
         break;
       case "mouseup":
         if (this[_dragging]) {
           this[_dragging] = null;
-          this._handleMarkerHover(this.hoveredPoint);
+          this._handleMarkerHover(null);
         }
         break;
       case "mousemove":
         if (!this[_dragging]) {
           this._handleMouseMoveNotDragging(pageX, pageY);
           return;
         }
         event.stopPropagation();
@@ -610,16 +610,17 @@ class ShapesHighlighter extends AutoRefr
 
       let ratioX = this.getUnitToPixelRatio(unitX, width);
       let ratioY = this.getUnitToPixelRatio(unitY, height);
       return { unitX, unitY, valueX, valueY, ratioX, ratioY };
     });
     this[_dragging] = { type, pointsInfo, x: pageX, y: pageY, bb: this.boundingBox,
                         matrix: this.transformMatrix,
                         transformedBB: this.transformedBoundingBox };
+    this._handleMarkerHover(this.hoveredPoint);
   }
 
   /**
    * Handle a click in transform mode while highlighting a circle.
    * @param {Number} pageX the x coordinate of the mouse.
    * @param {Number} pageY the y coordinate of the mouse.
    * @param {String} type the type of transform handle that was clicked.
    */
@@ -1379,17 +1380,19 @@ class ShapesHighlighter extends AutoRefr
         { pointName: "scale-se", x: se[0], y: se[1], anchor: "nw" },
         { pointName: "scale-ne", x: ne[0], y: ne[1], anchor: "sw" },
         { pointName: "scale-sw", x: sw[0], y: sw[1], anchor: "ne" },
         { pointName: "scale-nw", x: nw[0], y: nw[1], anchor: "se" },
         { pointName: "scale-n", x: n[0], y: n[1], anchor: "s" },
         { pointName: "scale-s", x: s[0], y: s[1], anchor: "n" },
         { pointName: "scale-e", x: e[0], y: e[1], anchor: "w" },
         { pointName: "scale-w", x: w[0], y: w[1], anchor: "e" },
-        { pointName: "rotate", x: rotatePoint[0], y: rotatePoint[1], cursor: "grab" },
+        { pointName: "rotate", x: rotatePoint[0], y: rotatePoint[1],
+          cursor: hoverCursor
+        },
       ];
 
       for (let { pointName, x, y, cursor, anchor } of points) {
         if (point === pointName) {
           this._drawHoverMarker([[x, y]]);
 
           // If the point is a scale handle, we will need to determine the direction
           // of the resize cursor based on the position of the handle relative to its