Fix selection handles on older API versions

The new assets didn't have the same padding on the edges as assets on older
versions. The adjustments to the getHotspotX code for the new assets broke
how the handles on older API versions were placed.

This CL updates the assets to have the same padding (i.e. handleWidth / 2
on each side of the handle and changes the getHotspotX methods for this.

Bug: 20829391
Change-Id: If7e466d200ef7757831bc763c3c3ce4a8bbf63fc
This commit is contained in:
Mady Mellor
2015-05-14 12:41:18 -07:00
parent 2a576d9ec1
commit 709386f501
11 changed files with 10 additions and 2 deletions

View File

@@ -3888,7 +3888,11 @@ public class Editor {
@Override
protected int getHotspotX(Drawable drawable, boolean isRtlRun) {
return isRtlRun ? 0 : drawable.getIntrinsicWidth();
if (isRtlRun) {
return drawable.getIntrinsicWidth() / 4;
} else {
return (drawable.getIntrinsicWidth() * 3) / 4;
}
}
@Override
@@ -4006,7 +4010,11 @@ public class Editor {
@Override
protected int getHotspotX(Drawable drawable, boolean isRtlRun) {
return isRtlRun ? drawable.getIntrinsicWidth() : 0;
if (isRtlRun) {
return (drawable.getIntrinsicWidth() * 3) / 4;
} else {
return drawable.getIntrinsicWidth() / 4;
}
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 15 KiB