Skip to content

Commit 34b1ad6

Browse files
committed
Remove unnecessary internal function
1 parent dab5327 commit 34b1ad6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/cropt.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff 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-
5955
function 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

6662
function 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) {

0 commit comments

Comments
 (0)