Merge "Fix calls to Rect.intersect(Rect)" into mnc-dev
This commit is contained in:
@@ -228,7 +228,9 @@ public abstract class Image implements AutoCloseable {
|
|||||||
|
|
||||||
if (cropRect != null) {
|
if (cropRect != null) {
|
||||||
cropRect = new Rect(cropRect); // make a copy
|
cropRect = new Rect(cropRect); // make a copy
|
||||||
cropRect.intersect(0, 0, getWidth(), getHeight());
|
if (!cropRect.intersect(0, 0, getWidth(), getHeight())) {
|
||||||
|
cropRect.setEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mCropRect = cropRect;
|
mCropRect = cropRect;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3240,8 +3240,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
// Clip to the window bounds.
|
// Clip to the window bounds.
|
||||||
Rect windowBounds = mTempRect1;
|
Rect windowBounds = mTempRect1;
|
||||||
getWindowBounds(focus.getWindowId(), windowBounds);
|
getWindowBounds(focus.getWindowId(), windowBounds);
|
||||||
boundsInScreen.intersect(windowBounds);
|
if (!boundsInScreen.intersect(windowBounds)) {
|
||||||
if (boundsInScreen.isEmpty()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3255,8 +3254,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
// Clip to the screen bounds.
|
// Clip to the screen bounds.
|
||||||
Point screenSize = mTempPoint;
|
Point screenSize = mTempPoint;
|
||||||
mDefaultDisplay.getRealSize(screenSize);
|
mDefaultDisplay.getRealSize(screenSize);
|
||||||
boundsInScreen.intersect(0, 0, screenSize.x, screenSize.y);
|
if (!boundsInScreen.intersect(0, 0, screenSize.x, screenSize.y)) {
|
||||||
if (boundsInScreen.isEmpty()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user