Fixing crash seen on developer console.

Basically, if the screen space gets really constrained, we would get a negative dimension for an image.
This commit is contained in:
Rodrigo Damazio
2010-08-31 17:35:38 -03:00
parent 3a8daadd92
commit 1e239b78c3
@@ -511,8 +511,8 @@ public class ChartView extends View {
// Dimensions have changed (for example due to orientation change):
w = c.getWidth();
h = c.getHeight();
effectiveWidth = w - leftBorder - RIGHT_BORDER;
effectiveHeight = h - TOP_BORDER - BOTTOM_BORDER;
effectiveWidth = Math.max(0, w - leftBorder - RIGHT_BORDER);
effectiveHeight = Math.max(0, h - TOP_BORDER - BOTTOM_BORDER);
setupPath();
}
c.save();