@@ -78,21 +78,29 @@ export class ClampZoom extends Plugin
7878 if ( this . options . minWidth !== null && width < this . options . minWidth )
7979 {
8080 const original = this . parent . scale . x ;
81+ console . log ( '-- minwidth' , this . parent . _wheelAxis ) ;
8182
8283 this . parent . fitWidth ( this . options . minWidth , false , false , true ) ;
83- this . parent . scale . y *= this . parent . scale . x / original ;
8484 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+ }
8690 this . parent . emit ( 'zoomed' , { viewport : this . parent , type : 'clamp-zoom' } ) ;
8791 }
8892 if ( this . options . maxWidth !== null && width > this . options . maxWidth )
8993 {
9094 const original = this . parent . scale . x ;
95+ console . log ( '-- maxwidth' , this . parent . _wheelAxis ) ;
9196
9297 this . parent . fitWidth ( this . options . maxWidth , false , false , true ) ;
93- this . parent . scale . y *= this . parent . scale . x / original ;
9498 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+ }
96104 this . parent . emit ( 'zoomed' , { viewport : this . parent , type : 'clamp-zoom' } ) ;
97105 }
98106 if ( this . options . minHeight !== null && height < this . options . minHeight )
0 commit comments