Skip to content

Vertical Coordinate Offset During Drawing in OSD/Annotorious Integration #611

@itayG98

Description

@itayG98

I am developing react 19 MUI 7 app with OSD 5.0.1. and annotorious 3.8.6

I am experiencing a consistent vertical coordinate offset when drawing new annotations.
this issue is strictly limited to the "drawing" phase; existing annotations remain correctly aligned when dragged or manipulated. Furthermore, the behavior is observed exclusively on wide, non-square images, suggesting an aspect-ratio-related coordinate transformation discrepancy.

my code is similar to this :

export const MyComp = ({ options }) => {
  const viewerRef = useRef(null);
  const osdInstance = useRef(null);
  const annoInstance = useRef(null);

  useEffect(() => {
    if (osdInstance.current) return;

    // Initialize OSD Viewer
    osdInstance.current = new OpenSeadragon.Viewer({
      element: viewerRef.current,
      ...options,
    });

    // Initialize Annotorious
    annoInstance.current = Annotorious(osdInstance.current, {
});

    // Cleanup
    return () => {
      if (annoInstance.current) {
        annoInstance.current.destroy();
        annoInstance.current = null;
      }
      if (osdInstance.current) {
        osdInstance.current.destroy();
        osdInstance.current = null;
      }
    };
  }, [options]);

  return (
    <Box
      ref={viewerRef}
      sx={{
        width: '100%',
        height: '100%', 
      }}
    />
  );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions