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 @@ -390,10 +390,6 @@ public boolean onScaleBegin(ScaleGestureDetector detector) {
390
390
@ Override
391
391
public boolean onScale (ScaleGestureDetector detector ) {
392
392
mNewHourHeight = Math .round (mHourHeight * detector .getScaleFactor ());
393
- if (mNewHourHeight < mEffectiveMinHourHeight )
394
- mNewHourHeight = mEffectiveMinHourHeight ;
395
- else if (mNewHourHeight > mMaxHourHeight )
396
- mNewHourHeight = mMaxHourHeight ;
397
393
invalidate ();
398
394
return true ;
399
395
}
@@ -474,6 +470,11 @@ private void drawHeaderRowAndEvents(Canvas canvas) {
474
470
475
471
//Calculate the new height due to the zooming.
476
472
if (mNewHourHeight > 0 ){
473
+ if (mNewHourHeight < mEffectiveMinHourHeight )
474
+ mNewHourHeight = mEffectiveMinHourHeight ;
475
+ else if (mNewHourHeight > mMaxHourHeight )
476
+ mNewHourHeight = mMaxHourHeight ;
477
+
477
478
mCurrentOrigin .y = (mCurrentOrigin .y /mHourHeight )*mNewHourHeight ;
478
479
mHourHeight = mNewHourHeight ;
479
480
mNewHourHeight = -1 ;
@@ -1175,7 +1176,7 @@ public int getHourHeight() {
1175
1176
}
1176
1177
1177
1178
public void setHourHeight (int hourHeight ) {
1178
- mHourHeight = hourHeight ;
1179
+ mNewHourHeight = hourHeight ;
1179
1180
invalidate ();
1180
1181
}
1181
1182
You can’t perform that action at this time.
0 commit comments