Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSeadragon + Annotorious, Zoom Out cause specifically shape rect not able to draw when click on the canvas #285

Open
rainyday321 opened this issue May 12, 2023 · 1 comment
Labels
v2.x Legacy 2.x relesae

Comments

@rainyday321
Copy link

Hi Guys, I recently encounter an issue with openseadragon + Annotorious, when i zoomOut and click on canvas in drawing mode, setDrawingEnabled(true); setDrawingTool('rect'). I unable to draw annotation anymore, even if reselect the rect shape, it only happen to 'rect' but freehand doesnt have this kind of issue and zoomIn does not have issue. This is my simplify version of code below:

<script>
function handleZoom (type , viewer) {
  const zoomRatio = type == 'zoomIn' ? 1.2 : 0.8
  viewer.viewport.zoomBy(zoomRatio , undefined , true)
} 
const viewer = OpenSeadragon({
  id : 'openseadragon',
  minZoomRatio : 0.25,
  maxZoomRator : 5,
  tileSource: {
    type : 'image',
    url : base64String
  },
   showHomeControl: false,
   showZoomControl: false
})
 const anno = Annotorious(viewer, {widgets : ['TAG']})

 const handleToolbarClick = (type) => {
   if (store.$state.selectorType === 'zoomIn' || store.$state.selectorType == 'zoomOut') {
    handleZoom(type , viewer)
   }
   else if (store.$state.selectorType == 'rect') {
     viewer.setMouseEnabled(false)
     viewer.setControlsEnabled(false)
     viewer.setDrawingEnabled(true)
     viewer.setDrawingTool('rect')
  }
 } 
</script>
<template>
  <EditorToolbar @change="handleToolbarClick"/>
</template>

Does anyone encouter this issues before?

@rainyday321
Copy link
Author

forget to mention both annotorious and openseadragon is version 2.7.10

@rsimon rsimon added the v2.x Legacy 2.x relesae label Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.x Legacy 2.x relesae
Projects
None yet
Development

No branches or pull requests

2 participants