annotationweb icon indicating copy to clipboard operation
annotationweb copied to clipboard

Fixed bug with scrolling/key press to move between frames

Open ingridtv opened this issue 4 years ago • 0 comments

I noticed that when hovering over the canvas and scrolling, the current frame number incremented/decremented beyond the range of frames (for me, below 0 and above the total number of frames). The same bug happened with key left/right presses. The canvas keeps displaying the first/last frame in the sequence, but the browser console gives an error message:

segmentation.js:357 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or OffscreenCanvas or SVGImageElement or VideoFrame)'.
    at redrawSequence (segmentation.js:357)
    at goToFrame (annotationweb.js:71)

I added if statements to the calls to goToFrame() in annotationweb.js that seems to fix the problem.

(cherry picked from commit 5e25cf99447b178788308d4115e8bcf63458ea7a)

ingridtv avatar Dec 15 '21 12:12 ingridtv