Bug 1307100 - Add handlesOffset only if height > 0. r=sebastian, a=ritu
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 11 Oct 2016 00:47:00 +0200
changeset 350652 63d6e12ae53374f06ad39535803962a37abcb2c4
parent 350651 97b73c8ba503bf0fb54136258a8c9653e5b50e9b
child 350653 a7e12adf2ee01578ba31c928a2e0084c4286bc45
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian, ritu
bugs1307100
milestone50.0
Bug 1307100 - Add handlesOffset only if height > 0. r=sebastian, a=ritu
mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
--- a/mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
+++ b/mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
@@ -191,14 +191,15 @@ public class FloatingToolbarTextSelectio
 
             final float zoomFactor = layerView.getZoomFactor();
             layerView.getLocationInWindow(locationInWindow);
 
             contentRect = new Rect(
                     (int) (x * zoomFactor + locationInWindow[0]),
                     (int) (y * zoomFactor + locationInWindow[1]  + layerView.getSurfaceTranslation()),
                     (int) ((x + width) * zoomFactor + locationInWindow[0]),
-                    (int) ((y + height) * zoomFactor + locationInWindow[1] + layerView.getSurfaceTranslation() + handlesOffset));
+                    (int) ((y + height) * zoomFactor + locationInWindow[1] + layerView.getSurfaceTranslation() +
+                           (height > 0 ? handlesOffset : 0)));
         } catch (JSONException e) {
             Log.w(LOGTAG, "Could not calculate content rect", e);
         }
     }
 }