set nine patch padding initially to an empty rectangle

Formerly, the padding state was set to null. Copying the padding
state fails when the null rectangle contents are referenced.

fixes http://b/2219785
This commit is contained in:
Cary Clark
2010-01-06 10:53:43 -05:00
parent 3886333644
commit e57b7b09b1

View File

@@ -81,7 +81,7 @@ public class NinePatchDrawable extends Drawable {
*/
@Deprecated
public NinePatchDrawable(NinePatch patch) {
this(new NinePatchState(patch, null), null);
this(new NinePatchState(patch, new Rect()), null);
}
/**
@@ -89,7 +89,7 @@ public class NinePatchDrawable extends Drawable {
* based on the display metrics of the resources.
*/
public NinePatchDrawable(Resources res, NinePatch patch) {
this(new NinePatchState(patch, null), res);
this(new NinePatchState(patch, new Rect()), res);
mNinePatchState.mTargetDensity = mTargetDensity;
}