format code using prettier
This commit is contained in:
parent
f06a7a6da1
commit
93b4cd065a
27 changed files with 326 additions and 260 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue