diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/BitmapCropBehaviour.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/BitmapCropBehaviour.java index 9bd4f5b7e..f982743eb 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/BitmapCropBehaviour.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/BitmapCropBehaviour.java @@ -21,12 +21,12 @@ public class BitmapCropBehaviour implements CropperBehaviour{ public void pan(float panX, float panY) { if(mHostView.horizontalLock) panX = 0; if(mHostView.verticalLock) panY = 0; - mTranslateMatrix.postTranslate(panX, panY); if(panX != 0 || panY != 0) { - // Only mark the matrix as outdated if any amount of panning has occured + // Actually translate and refresh only if either of the pan deltas are nonzero + mTranslateMatrix.postTranslate(panX, panY); mTranslateInverseOutdated = true; + refresh(); } - refresh(); } public void zoom(float zoomLevel, float midpointX, float midpointY) { @@ -83,7 +83,7 @@ public class BitmapCropBehaviour implements CropperBehaviour{ Matrix imageInverse = new Matrix(); inverse(mImageMatrix, imageInverse); // By inverting the matrix we will effectively "divide" our rectangle by it, thus getting - // its two points on the bitmap's surface. Math be cool indeed. + // its two points on the surface of the bitmap. Math be cool indeed. float[] src = new float[] { mHostView.mSelectionRect.left, mHostView.mSelectionRect.top, diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/CropperView.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/CropperView.java index ed5a4d07e..b991d6525 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/CropperView.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/CropperView.java @@ -139,8 +139,8 @@ public class CropperView extends View { } @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); + protected void onSizeChanged(int w, int h, int oldW, int oldH) { + super.onSizeChanged(w, h, oldW, oldH); int lesserDimension = (int)(Math.min(w, h) - mSelectionPadding); // Calculate the corners of the new selection frame. It should always appear at the center of the view. int centerShiftX = (w - lesserDimension) / 2; diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/RegionDecoderCropBehaviour.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/RegionDecoderCropBehaviour.java index f40ae707c..5ee65d071 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/RegionDecoderCropBehaviour.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/imgcropper/RegionDecoderCropBehaviour.java @@ -38,7 +38,7 @@ public class RegionDecoderCropBehaviour extends BitmapCropBehaviour { }; /** - * Decoade a region from this Bitmap based on a subsection in the View coordinate space. + * Decode a region from this Bitmap based on a subsection in the View coordinate space. * @param targetDrawRect an output Rect. This Rect is the position at which the region must * be rendered within subsectionRect. * @param subsectionRect the subsection in View coordinate space. Note that this Rect is modified @@ -46,7 +46,7 @@ public class RegionDecoderCropBehaviour extends BitmapCropBehaviour { * @return null if the resulting region is bigger than the original image * null if the resulting region is completely out of the original image bounds * null if the resulting region is smaller than 16x16 pixels - * null if a region decoding error has occured + * null if a region decoding error has occurred * the resulting Bitmap region otherwise. */ private Bitmap decodeRegionBitmap(RectF targetDrawRect, RectF subsectionRect) { @@ -189,7 +189,7 @@ public class RegionDecoderCropBehaviour extends BitmapCropBehaviour { /** * Transform the coordinates of the Rect using the supplied Matrix. - * @param rect the input/ouput Rect for this operation + * @param rect the input/output Rect for this operation * @param regionImageInverse the Matrix for transforming the Rect. */ private void transformRect(RectF rect, Matrix regionImageInverse) {