use of com.android.gallery3d.filtershow.crop.CropObject in project android_packages_apps_Gallery2 by LineageOS.
the class ImageCrop method forceStateConsistency.
private void forceStateConsistency() {
MasterImage master = MasterImage.getImage();
Bitmap image = master.getFiltersOnlyImage();
FilterShowActivity filterShowActivity = (FilterShowActivity) getContext();
boolean isReload = filterShowActivity.isReloadByConfigurationChanged();
int width = image.getWidth();
int height = image.getHeight();
if (mCropObj == null || (!mUpdateHolder.equals(mGeometry) && !isReload) || mImageBounds.width() != width || mImageBounds.height() != height || !mLocalRep.getCrop().equals(mUpdateHolder.crop)) {
mImageBounds.set(0, 0, width, height);
mGeometry.set(mUpdateHolder);
mLocalRep.setCrop(mUpdateHolder.crop);
RectF scaledCrop = new RectF(mUpdateHolder.crop);
FilterCropRepresentation.findScaledCrop(scaledCrop, width, height);
mCropObj = new CropObject(mImageBounds, scaledCrop, (int) mUpdateHolder.straighten);
mState = Mode.NONE;
clearDisplay();
}
}
Aggregations