zolaemil / meiView

JavaScript demo application displaying variant readings of historical musical pieces
http://zolaemil.github.io/meiView
7 stars 3 forks source link

In Safari, Firefox for OS X and Chrome for iOS score only appears after a click on the canvas #4

Closed zolaemil closed 10 years ago

zolaemil commented 11 years ago

fabric.Canvas.renderAll() sometimes doesn't work properly.

In Firefox, when debugging if I put a breakpoint right before the renderAll() call and then 'step over', it would re-render properly. However, when execution doesn't stop, sometimes it wouldn't render.

A 0ms long delay before the execution of .renderAll seems to eliminate the problem in Firefox, but not entirely in Safari. In Safari, it still happens sometimes, that the variant selector box appears, but only one or no variant is shown at all.

Both in Safari and Firefox, if I reload the page while the #pg parameter is set (for example meiView.html#pg=2) renderAll doesn't work)

Interestingly in Firefox, the browser cash helps the rendering, that is:

  1. open meiView.html#pg=3
  2. empty the cash
  3. reload the page --> score doesn't appear
  4. reload the page again --> score appears
zolaemil commented 11 years ago

try using something other than staticCanvas.toDataURL()?