How to magnify multiple elements on a canvas using the javascript magnifier

Essentially I have a web page that displays an image excerpt from a document using drawimage(x,z,width,height). The user has the ability to draw a rectangle around any given line on the image by clicking the line. The image then has a rectangle drawn on it using rect(x,y,w,h). Using the javascript magnifier the user can hover over the image to see a zoomed in version. However it does not show the rectangle drawn on to the image on the canvas. Is it possible to draw both the rectangle and the image? currently this is the setup for the magnifier: Later on