Minor layout improvements for HabitScoreView

pull/84/head
Alinson S. Xavier 10 years ago
parent 9e5f3d8f58
commit 767ec1b6de

@ -172,8 +172,10 @@ public class HabitScoreView extends ScrollableDataView implements HabitDataView
columnWidth = Math.max(columnWidth, getMaxDayWidth() * 1.5f); columnWidth = Math.max(columnWidth, getMaxDayWidth() * 1.5f);
columnWidth = Math.max(columnWidth, getMaxMonthWidth() * 1.2f); columnWidth = Math.max(columnWidth, getMaxMonthWidth() * 1.2f);
columnHeight = 8 * baseSize;
nColumns = (int) (width / columnWidth); nColumns = (int) (width / columnWidth);
columnWidth = (float) width / nColumns;
columnHeight = 8 * baseSize;
pGraph.setTextSize(baseSize * 0.5f); pGraph.setTextSize(baseSize * 0.5f);
pGraph.setStrokeWidth(baseSize * 0.1f); pGraph.setStrokeWidth(baseSize * 0.1f);
@ -246,7 +248,8 @@ public class HabitScoreView extends ScrollableDataView implements HabitDataView
int height = (int) (columnHeight * relativeScore); int height = (int) (columnHeight * relativeScore);
rect.set(0, 0, baseSize, baseSize); rect.set(0, 0, baseSize, baseSize);
rect.offset(k * columnWidth, paddingTop + columnHeight - height - columnWidth / 2); rect.offset(k * columnWidth + (columnWidth - baseSize) / 2,
paddingTop + columnHeight - height - columnWidth / 2);
if (!prevRect.isEmpty()) if (!prevRect.isEmpty())
{ {

Loading…
Cancel
Save