Merge change I4e03999c into eclair
* changes: if we have a single value for roundrect radius, manually clamp it before drawing.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user