am 0084c1cd: am 9fcd581a: Merge change I4e03999c into eclair

Merge commit '0084c1cdc26338b779df2978bb8300df5424f29a'

* commit '0084c1cdc26338b779df2978bb8300df5424f29a':
  if we have a single value for roundrect radius, manually clamp it before drawing.
This commit is contained in:
Mike Reed
2009-10-01 11:55:54 -07:00
committed by Android Git Automerger

View File

@@ -319,7 +319,16 @@ public class GradientDrawable extends Drawable {
}
}
else {
// since the caller is only giving us 1 value, we will force
// it to be square if the rect is too small in one dimension
// to show it. If we did nothing, Skia would clamp the rad
// independently along each axis, giving us a thin ellips
// if the rect were very wide but not very tall
float rad = st.mRadius;
float r = Math.min(mRect.width(), mRect.height()) * 0.5f;
if (rad > r) {
rad = r;
}
canvas.drawRoundRect(mRect, rad, rad, mFillPaint);
if (haveStroke) {
canvas.drawRoundRect(mRect, rad, rad, mStrokePaint);