File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,15 +52,11 @@ function debounce<T extends Function>(func: T, wait: number) {
5252 } ;
5353}
5454
55- function fix ( value : number , decimalPoints : number ) {
56- return value . toFixed ( decimalPoints ) ;
57- }
58-
5955function setZoomerVal ( value : number , zoomer : HTMLInputElement ) {
6056 const zMin = parseFloat ( zoomer . min ) ;
6157 const zMax = parseFloat ( zoomer . max ) ;
6258
63- zoomer . value = fix ( Math . max ( zMin , Math . min ( zMax , value ) ) , 3 ) ;
59+ zoomer . value = Math . max ( zMin , Math . min ( zMax , value ) ) . toFixed ( 3 ) ;
6460}
6561
6662function loadImage ( src : string ) : Promise < HTMLImageElement > {
@@ -682,8 +678,8 @@ export class Cropt {
682678 maxZoom += minZoom ;
683679 }
684680
685- this . elements . zoomer . min = fix ( minZoom , 3 ) ;
686- this . elements . zoomer . max = fix ( maxZoom , 3 ) ;
681+ this . elements . zoomer . min = minZoom . toFixed ( 3 ) ;
682+ this . elements . zoomer . max = maxZoom . toFixed ( 3 ) ;
687683 let zoom = this . #boundZoom;
688684
689685 if ( zoom === null ) {
You can’t perform that action at this time.
0 commit comments