summaryrefslogtreecommitdiff
path: root/core/java/android/widget/SmartSelectSprite.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-09-29 21:05:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-09-29 21:05:46 +0000
commitd96b97b855f4fbd22690b4f261d6c39f0f4d49f3 (patch)
tree345b490f5d4afbe4bc38a1644f06909be5f3fba8 /core/java/android/widget/SmartSelectSprite.java
parente93e6c5ef185be90431c11345a609364be654f20 (diff)
parentc1950a00526d0af9a9279ded0b4e8812d9daa2f9 (diff)
Merge "Do not draw rectangles with the same left and right boundaries"
Diffstat (limited to 'core/java/android/widget/SmartSelectSprite.java')
-rw-r--r--core/java/android/widget/SmartSelectSprite.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/widget/SmartSelectSprite.java b/core/java/android/widget/SmartSelectSprite.java
index 27eff4394f96..7cbc494b37af 100644
--- a/core/java/android/widget/SmartSelectSprite.java
+++ b/core/java/android/widget/SmartSelectSprite.java
@@ -146,9 +146,9 @@ final class SmartSelectSprite {
private final RectF mClipRect = new RectF();
private final Path mClipPath = new Path();
- /** How far offset the left edge of the rectangle is from the bounding box. */
+ /** How offset the left edge of the rectangle is from the left side of the bounding box. */
private float mLeftBoundary = 0;
- /** How far offset the right edge of the rectangle is from the bounding box. */
+ /** How offset the right edge of the rectangle is from the left side of the bounding box. */
private float mRightBoundary = 0;
/** Whether the horizontal bounds are inverted (for RTL scenarios). */
@@ -193,6 +193,10 @@ final class SmartSelectSprite {
*/
@Override
public void draw(Canvas canvas, Paint paint) {
+ if (mLeftBoundary == mRightBoundary) {
+ return;
+ }
+
final float cornerRadius = getCornerRadius();
final float adjustedCornerRadius = getAdjustedCornerRadius();