Skip to content

Commit dda316e

Browse files
committed
fix(frontend): windows pixel issue
1 parent 1e26c1d commit dda316e

File tree

1 file changed

+6
-3
lines changed
  • apps/frontend/src/pages/tasks.[id].samples.[id]

1 file changed

+6
-3
lines changed

apps/frontend/src/pages/tasks.[id].samples.[id]/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export const imageAnnotationRef = createRef<ImageAnnotatorRef>();
3838
export const videoAnnotationRef = createRef<AudioAndVideoAnnotatorRef>();
3939
export const audioAnnotationRef = createRef<AudioAndVideoAnnotatorRef>();
4040

41+
const PREVIEW_OFFSET_TOP = 102;
42+
const OFFSET_TOP = 158;
43+
4144
const AnnotationPage = () => {
4245
const routeParams = useParams();
4346
const { task } = useRouteLoaderData('task') as TaskLoaderResult;
@@ -308,7 +311,7 @@ const AnnotationPage = () => {
308311
ref={imageAnnotationRef}
309312
onError={onError}
310313
// windows platform pixel issue
311-
offsetTop={configFromParent ? 100 : 158}
314+
offsetTop={configFromParent ? PREVIEW_OFFSET_TOP : OFFSET_TOP}
312315
editingSample={editingSample}
313316
config={config}
314317
disabled={disabled}
@@ -326,7 +329,7 @@ const AnnotationPage = () => {
326329
<Annotator
327330
primaryColor="#0d53de"
328331
ref={videoAnnotationRef}
329-
offsetTop={configFromParent ? 100 : 156}
332+
offsetTop={configFromParent ? PREVIEW_OFFSET_TOP : OFFSET_TOP}
330333
editingSample={editingSample}
331334
config={config}
332335
toolbarRight={topActionContent}
@@ -346,7 +349,7 @@ const AnnotationPage = () => {
346349
<AudioAnnotator
347350
primaryColor="#0d53de"
348351
ref={audioAnnotationRef}
349-
offsetTop={configFromParent ? 100 : 156}
352+
offsetTop={configFromParent ? PREVIEW_OFFSET_TOP : OFFSET_TOP}
350353
editingSample={editingSample}
351354
config={config}
352355
disabled={disabled}

0 commit comments

Comments
 (0)