Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f35c8d77 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "cherrypicker-L31500000961697753:N79800001383851094"...

Merge changes from topic "cherrypicker-L31500000961697753:N79800001383851094" into udc-qpr-dev am: 4c440498

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23859834



Change-Id: Icd9424b88d5b446ee23349bfe31fb63339f58a78
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b141d6ab 4c440498
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -270,21 +270,16 @@ public class MagnificationThumbnail {
            mThumbnailView.setScaleX(scaleDown);
            mThumbnailView.setScaleY(scaleDown);
        }
        float thumbnailWidth;
        float thumbnailHeight;
        if (mThumbnailView.getWidth() == 0 || mThumbnailView.getHeight() == 0) {
            // if the thumbnail view size is not updated correctly, we just use the cached values.
            thumbnailWidth = mThumbnailWidth;
            thumbnailHeight = mThumbnailHeight;
        } else {
            thumbnailWidth = mThumbnailView.getWidth();
            thumbnailHeight = mThumbnailView.getHeight();
        }
        if (!Float.isNaN(centerX)) {

        if (!Float.isNaN(centerX)
                && !Float.isNaN(centerY)
                && mThumbnailWidth > 0
                && mThumbnailHeight > 0
        ) {
            var padding = mThumbnailView.getPaddingTop();
            var ratio = 1f / BG_ASPECT_RATIO;
            var centerXScaled = centerX * ratio - (thumbnailWidth / 2f + padding);
            var centerYScaled = centerY * ratio - (thumbnailHeight / 2f + padding);
            var centerXScaled = centerX * ratio - (mThumbnailWidth / 2f + padding);
            var centerYScaled = centerY * ratio - (mThumbnailHeight / 2f + padding);

            if (DEBUG) {
                Log.d(