Fixing wrong cliping height when screenshot is rotated
Bug: 77979532 Change-Id: I41aa5dc85a035e7936861412f3d77e22143eaf81
This commit is contained in:
1 parent
efa87b8d3a
commit
f3dbad134b
1 file changed
+4
-3
@@ -167,9 +167,9 @@ public class TaskThumbnailView extends View {
|
||||
if (mBitmapShader != null && mThumbnailData != null) {
|
||||
float scale = mThumbnailData.scale;
|
||||
Rect thumbnailInsets = mThumbnailData.insets;
|
||||
float thumbnailWidth = mThumbnailData.thumbnail.getWidth() -
|
||||
final float thumbnailWidth = mThumbnailData.thumbnail.getWidth() -
|
||||
(thumbnailInsets.left + thumbnailInsets.right) * scale;
|
||||
float thumbnailHeight = mThumbnailData.thumbnail.getHeight() -
|
||||
final float thumbnailHeight = mThumbnailData.thumbnail.getHeight() -
|
||||
(thumbnailInsets.top + thumbnailInsets.bottom) * scale;
|
||||
|
||||
final float thumbnailScale;
|
||||
@@ -216,7 +216,8 @@ public class TaskThumbnailView extends View {
|
||||
mMatrix.postScale(thumbnailScale, thumbnailScale);
|
||||
mBitmapShader.setLocalMatrix(mMatrix);
|
||||
|
||||
float bitmapHeight = Math.max(thumbnailHeight * thumbnailScale, 0);
|
||||
float bitmapHeight = Math.max((rotate ? thumbnailWidth : thumbnailHeight)
|
||||
* thumbnailScale, 0);
|
||||
if (Math.round(bitmapHeight) < getMeasuredHeight()) {
|
||||
mClipBottom = bitmapHeight;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user