diff options
| author | Petar Šegina <psegina@google.com> | 2017-09-27 20:06:39 +0100 |
|---|---|---|
| committer | Petar Šegina <psegina@google.com> | 2017-09-29 18:39:40 +0100 |
| commit | c1950a00526d0af9a9279ded0b4e8812d9daa2f9 (patch) | |
| tree | 8f793f0e4c8be665ccd0a772f15f40835b847d9f /core/java/android/widget/SmartSelectSprite.java | |
| parent | 2a791ee46cf7e15da4de687c03d27724dbac186c (diff) | |
Do not draw rectangles with the same left and right boundaries
These should not be drawn at all, but the expansion logic for OVERSHOOT
and LEFT and RIGHT rectangles will expand the rectangle into something
that gets drawn.
Test: manual - triggered smart selection and verified that rectangles on
non-primary lines do not get prematurely shown
Change-Id: I5235e4b214401e6ceee3f07bc5cc937907c261ba
Diffstat (limited to 'core/java/android/widget/SmartSelectSprite.java')
| -rw-r--r-- | core/java/android/widget/SmartSelectSprite.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/widget/SmartSelectSprite.java b/core/java/android/widget/SmartSelectSprite.java index 27b93bc74969..d9a72046fe93 100644 --- a/core/java/android/widget/SmartSelectSprite.java +++ b/core/java/android/widget/SmartSelectSprite.java @@ -114,9 +114,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; private RoundedRectangleShape( @@ -148,6 +148,10 @@ final class SmartSelectSprite { */ @Override public void draw(Canvas canvas, Paint paint) { + if (mLeftBoundary == mRightBoundary) { + return; + } + final float cornerRadius = getCornerRadius(); final float adjustedCornerRadius = getAdjustedCornerRadius(); |
