File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
library/src/main/java/com/alamkanak/weekview Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -393,10 +393,6 @@ public boolean onScaleBegin(ScaleGestureDetector detector) {
393
393
@ Override
394
394
public boolean onScale (ScaleGestureDetector detector ) {
395
395
mNewHourHeight = Math .round (mHourHeight * detector .getScaleFactor ());
396
- if (mNewHourHeight < mEffectiveMinHourHeight )
397
- mNewHourHeight = mEffectiveMinHourHeight ;
398
- else if (mNewHourHeight > mMaxHourHeight )
399
- mNewHourHeight = mMaxHourHeight ;
400
396
invalidate ();
401
397
return true ;
402
398
}
@@ -483,6 +479,11 @@ private void drawHeaderRowAndEvents(Canvas canvas) {
483
479
484
480
//Calculate the new height due to the zooming.
485
481
if (mNewHourHeight > 0 ){
482
+ if (mNewHourHeight < mEffectiveMinHourHeight )
483
+ mNewHourHeight = mEffectiveMinHourHeight ;
484
+ else if (mNewHourHeight > mMaxHourHeight )
485
+ mNewHourHeight = mMaxHourHeight ;
486
+
486
487
mCurrentOrigin .y = (mCurrentOrigin .y /mHourHeight )*mNewHourHeight ;
487
488
mHourHeight = mNewHourHeight ;
488
489
mNewHourHeight = -1 ;
@@ -1171,7 +1172,7 @@ public int getHourHeight() {
1171
1172
}
1172
1173
1173
1174
public void setHourHeight (int hourHeight ) {
1174
- mHourHeight = hourHeight ;
1175
+ mNewHourHeight = hourHeight ;
1175
1176
invalidate ();
1176
1177
}
1177
1178
You can’t perform that action at this time.
0 commit comments