format code using prettier

This commit is contained in:
thislight 2024-08-05 15:33:00 +08:00
parent f06a7a6da1
commit 93b4cd065a
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
27 changed files with 326 additions and 260 deletions

View file

@ -36,7 +36,7 @@ function within(n: number, target: number, range: number) {
}
function clamp(input: number, min: number, max: number) {
return Math.min(Math.max(input, min), max)
return Math.min(Math.max(input, min), max);
}
const MediaViewer: ParentComponent<MediaViewerProps> = (props) => {
@ -207,7 +207,13 @@ const MediaViewer: ParentComponent<MediaViewerProps> = (props) => {
move: number,
idx: number,
) => {
const { ref, top: otop, left: oleft, scale: oscale, osize: [owidth, oheight] } = state[idx];
const {
ref,
top: otop,
left: oleft,
scale: oscale,
osize: [owidth, oheight],
} = state[idx];
const [cx, cy] = center;
const iy = clamp(cy - otop, 0, oheight),
ix = clamp(cx - oleft, 0, owidth); // in image coordinate system