Bug 1307100 - Add handlesOffset only if height > 0. r=sebastian
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 05 Oct 2016 13:47:11 +0800
changeset 316588 dbaae495b5bfea4296d124da1c8439e1e6cb133d
parent 316587 4372532be22197d6d182073023358431617574ba
child 316589 c075dbe4e001980da5d4d288c9c181d321ee95cb
push id30778
push usercbook@mozilla.com
push dateThu, 06 Oct 2016 09:56:14 +0000
treeherdermozilla-central@cc3ee8d499c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1307100
milestone52.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 1307100 - Add handlesOffset only if height > 0. r=sebastian Per bug 1307100 comment 3, we use "height equals to 0" to hide the floating toolbar so we only need to adjust the handlesOffset when height > 0. MozReview-Commit-ID: AdIOxIFUrI
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
@@ -192,14 +192,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]),
                     (int) ((x + width) * zoomFactor + locationInWindow[0]),
-                    (int) ((y + height) * zoomFactor + locationInWindow[1] + handlesOffset));
+                    (int) ((y + height) * zoomFactor + locationInWindow[1] +
+                           (height > 0 ? handlesOffset : 0)));
         } catch (JSONException e) {
             Log.w(LOGTAG, "Could not calculate content rect", e);
         }
     }
 }