@@ -78,21 +78,29 @@ export class ClampZoom extends Plugin
78
78
if ( this . options . minWidth !== null && width < this . options . minWidth )
79
79
{
80
80
const original = this . parent . scale . x ;
81
+ console . log ( '-- minwidth' , this . parent . _wheelAxis ) ;
81
82
82
83
this . parent . fitWidth ( this . options . minWidth , false , false , true ) ;
83
- this . parent . scale . y *= this . parent . scale . x / original ;
84
84
width = this . parent . worldScreenWidth ;
85
- height = this . parent . worldScreenHeight ;
85
+
86
+ if ( [ 'all' , 'y' ] . includes ( this . parent . _wheelAxis ) ) {
87
+ this . parent . scale . y *= this . parent . scale . x / original ;
88
+ height = this . parent . worldScreenHeight ;
89
+ }
86
90
this . parent . emit ( 'zoomed' , { viewport : this . parent , type : 'clamp-zoom' } ) ;
87
91
}
88
92
if ( this . options . maxWidth !== null && width > this . options . maxWidth )
89
93
{
90
94
const original = this . parent . scale . x ;
95
+ console . log ( '-- maxwidth' , this . parent . _wheelAxis ) ;
91
96
92
97
this . parent . fitWidth ( this . options . maxWidth , false , false , true ) ;
93
- this . parent . scale . y *= this . parent . scale . x / original ;
94
98
width = this . parent . worldScreenWidth ;
95
- height = this . parent . worldScreenHeight ;
99
+
100
+ if ( [ 'all' , 'y' ] . includes ( this . parent . _wheelAxis ) ) {
101
+ this . parent . scale . y *= this . parent . scale . x / original ;
102
+ height = this . parent . worldScreenHeight ;
103
+ }
96
104
this . parent . emit ( 'zoomed' , { viewport : this . parent , type : 'clamp-zoom' } ) ;
97
105
}
98
106
if ( this . options . minHeight !== null && height < this . options . minHeight )
0 commit comments