@@ -26,15 +26,21 @@ export type Params = {
2626 */
2727export function restrictor < Schemes extends BaseSchemes , K > ( plugin : AreaPlugin < Schemes , K > , params ?: Params ) {
2828 const scaling = params ?. scaling
29- ? params . scaling === true ? { min : 0.1 , max : 1 } : params . scaling
29+ ? params . scaling === true
30+ ? { min : 0.1 , max : 1 }
31+ : params . scaling
3032 : false
3133 const translation = params ?. translation
32- ? params . translation === true ? { left : 0 , top : 0 , right : 1000 , bottom : 1000 } : params . translation
34+ ? params . translation === true
35+ ? { left : 0 , top : 0 , right : 1000 , bottom : 1000 }
36+ : params . translation
3337 : false
3438
3539 function restrictZoom ( zoom : number ) {
3640 if ( ! scaling ) throw new Error ( 'scaling param isnt defined' )
37- const { min, max } = typeof scaling === 'function' ? scaling ( ) : scaling
41+ const { min, max } = typeof scaling === 'function'
42+ ? scaling ( )
43+ : scaling
3844
3945 if ( zoom < min ) {
4046 return min
@@ -82,7 +88,7 @@ export function restrictor<Schemes extends BaseSchemes, K>(plugin: AreaPlugin<Sc
8288 if ( translation && context . type === 'zoomed' ) {
8389 const position = restrictPosition ( plugin . area . transform )
8490
85- plugin . area . translate ( position . x , position . y )
91+ void plugin . area . translate ( position . x , position . y )
8692 }
8793 if ( translation && context . type === 'translate' ) {
8894 return {
0 commit comments