Merge changes from topic "cherrypicker-L31500000961697753:N79800001383851094" into udc-qpr-dev am: 4c440498b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23859834 Change-Id: Icd9424b88d5b446ee23349bfe31fb63339f58a78 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -270,21 +270,16 @@ public class MagnificationThumbnail {
|
|||||||
mThumbnailView.setScaleX(scaleDown);
|
mThumbnailView.setScaleX(scaleDown);
|
||||||
mThumbnailView.setScaleY(scaleDown);
|
mThumbnailView.setScaleY(scaleDown);
|
||||||
}
|
}
|
||||||
float thumbnailWidth;
|
|
||||||
float thumbnailHeight;
|
if (!Float.isNaN(centerX)
|
||||||
if (mThumbnailView.getWidth() == 0 || mThumbnailView.getHeight() == 0) {
|
&& !Float.isNaN(centerY)
|
||||||
// if the thumbnail view size is not updated correctly, we just use the cached values.
|
&& mThumbnailWidth > 0
|
||||||
thumbnailWidth = mThumbnailWidth;
|
&& mThumbnailHeight > 0
|
||||||
thumbnailHeight = mThumbnailHeight;
|
) {
|
||||||
} else {
|
|
||||||
thumbnailWidth = mThumbnailView.getWidth();
|
|
||||||
thumbnailHeight = mThumbnailView.getHeight();
|
|
||||||
}
|
|
||||||
if (!Float.isNaN(centerX)) {
|
|
||||||
var padding = mThumbnailView.getPaddingTop();
|
var padding = mThumbnailView.getPaddingTop();
|
||||||
var ratio = 1f / BG_ASPECT_RATIO;
|
var ratio = 1f / BG_ASPECT_RATIO;
|
||||||
var centerXScaled = centerX * ratio - (thumbnailWidth / 2f + padding);
|
var centerXScaled = centerX * ratio - (mThumbnailWidth / 2f + padding);
|
||||||
var centerYScaled = centerY * ratio - (thumbnailHeight / 2f + padding);
|
var centerYScaled = centerY * ratio - (mThumbnailHeight / 2f + padding);
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(
|
Log.d(
|
||||||
|
|||||||
Reference in New Issue
Block a user