Skip to content

Commit 2538a9a

Browse files
author
Jens Claes
committed
Merge branch 'iss8-vertical-zooming' into quivr-master
2 parents 834636c + 2f428cb commit 2538a9a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,6 @@ public boolean onScaleBegin(ScaleGestureDetector detector) {
393393
@Override
394394
public boolean onScale(ScaleGestureDetector detector) {
395395
mNewHourHeight = Math.round(mHourHeight * detector.getScaleFactor());
396-
if(mNewHourHeight < mEffectiveMinHourHeight)
397-
mNewHourHeight = mEffectiveMinHourHeight;
398-
else if(mNewHourHeight > mMaxHourHeight)
399-
mNewHourHeight = mMaxHourHeight;
400396
invalidate();
401397
return true;
402398
}
@@ -483,6 +479,11 @@ private void drawHeaderRowAndEvents(Canvas canvas) {
483479

484480
//Calculate the new height due to the zooming.
485481
if (mNewHourHeight > 0){
482+
if(mNewHourHeight < mEffectiveMinHourHeight)
483+
mNewHourHeight = mEffectiveMinHourHeight;
484+
else if(mNewHourHeight > mMaxHourHeight)
485+
mNewHourHeight = mMaxHourHeight;
486+
486487
mCurrentOrigin.y = (mCurrentOrigin.y/mHourHeight)*mNewHourHeight;
487488
mHourHeight = mNewHourHeight;
488489
mNewHourHeight = -1;
@@ -1171,7 +1172,7 @@ public int getHourHeight() {
11711172
}
11721173

11731174
public void setHourHeight(int hourHeight) {
1174-
mHourHeight = hourHeight;
1175+
mNewHourHeight = hourHeight;
11751176
invalidate();
11761177
}
11771178

0 commit comments

Comments
 (0)