Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into develop
  • Loading branch information
thellmund committed Feb 14, 2019
2 parents 7c04ca5 + dcbeca1 commit 716124b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@ int computeDifferenceWithFirstDayOfWeek(@NonNull WeekViewConfig config ,@NonNull

void refreshAfterZooming(WeekViewConfig config) {
if (newHourHeight > 0 && !config.showCompleteDay) {
if (newHourHeight < config.effectiveMinHourHeight) {
newHourHeight = config.effectiveMinHourHeight;
} else if (newHourHeight > config.maxHourHeight) {
newHourHeight = config.maxHourHeight;
}
newHourHeight = Math.max(newHourHeight, config.effectiveMinHourHeight);
newHourHeight = Math.min(newHourHeight, config.maxHourHeight);

// potentialMinHourHeight
// the minimal height of an hour when zoomed completely out
// needed to suppress the zooming below 24:00
final int height = WeekView.getViewHeight();
float potentialMinHourHeight = (height - headerHeight) / Constants.HOURS_PER_DAY;
newHourHeight = Math.max(newHourHeight, potentialMinHourHeight);

currentOrigin.y = (currentOrigin.y / config.hourHeight) * newHourHeight;
config.hourHeight = newHourHeight;
Expand All @@ -227,7 +231,7 @@ void updateVerticalOrigin(WeekViewConfig config) {
final int height = WeekView.getViewHeight();

// If the new currentOrigin.y is invalid, make it valid.
final float dayHeight = config.hourHeight * 24;
final float dayHeight = config.hourHeight * Constants.HOURS_PER_DAY;

final float potentialNewVerticalOrigin = height - (dayHeight + headerHeight);

Expand Down

0 comments on commit 716124b

Please sign in to comment.