Bug 1208863 - CropImageView: Reset matrix before reusing it. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 23 Oct 2015 19:52:34 +0200
changeset 304497 746279c34dcbb590100483c7c14dfc06b410d869
parent 304496 c5b8d410813360d376676fb3ab72d93bd7f1b0c4
child 304498 79a231b4477d1811bc85a1ad1cb916a5dae401b4
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1208863
milestone44.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 1208863 - CropImageView: Reset matrix before reusing it. r=margaret
mobile/android/base/widget/CropImageView.java
--- a/mobile/android/base/widget/CropImageView.java
+++ b/mobile/android/base/widget/CropImageView.java
@@ -88,16 +88,17 @@ public abstract class CropImageView exte
 
         getDrawable().setBounds(0, 0, viewWidth, viewHeight);
 
         final float horizontalScaleValue = (float) viewWidth / (float) drawableWidth;
         final float verticalScaleValue = (float) viewHeight / (float) drawableHeight;
 
         final float scale = Math.max(verticalScaleValue, horizontalScaleValue);
 
+        layoutNextMatrix.reset();
         layoutNextMatrix.setScale(scale, scale);
         setImageMatrix(layoutNextMatrix);
 
         // You can't modify the matrix in place and we want to avoid allocation, so let's keep two references to two
         // different matrix objects that we can swap when the values need to change
         final Matrix swapReferenceMatrix = layoutCurrentMatrix;
         layoutCurrentMatrix = layoutNextMatrix;
         layoutNextMatrix = swapReferenceMatrix;