forked from upstream-mirrors/OpenTracks
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:
@@ -511,8 +511,8 @@ public class ChartView extends View {
|
|||||||
// Dimensions have changed (for example due to orientation change):
|
// Dimensions have changed (for example due to orientation change):
|
||||||
w = c.getWidth();
|
w = c.getWidth();
|
||||||
h = c.getHeight();
|
h = c.getHeight();
|
||||||
effectiveWidth = w - leftBorder - RIGHT_BORDER;
|
effectiveWidth = Math.max(0, w - leftBorder - RIGHT_BORDER);
|
||||||
effectiveHeight = h - TOP_BORDER - BOTTOM_BORDER;
|
effectiveHeight = Math.max(0, h - TOP_BORDER - BOTTOM_BORDER);
|
||||||
setupPath();
|
setupPath();
|
||||||
}
|
}
|
||||||
c.save();
|
c.save();
|
||||||
|
|||||||
Reference in New Issue
Block a user