skyvory / vn-canvas

Automatically exported from code.google.com/p/vn-canvas
0 stars 1 forks source link

Firefox unable to load scene as image: "canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored." #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Set up vntemplate as in issue 13 ( 
http://code.google.com/p/vn-canvas/issues/detail?id=13 )

2. create chapter1.js and add it to TOC. chapter1.js in its entirety:

chapter1  = [
    scene, {src:"gravesite.jpg"},
    wait, 0
]

Expected output:
Draw gravesite.jpg as the scene background

Observed output:
canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a 
string, a CanvasGradient, or a CanvasPattern was ignored. The background 
remains black.

Linux Mint, Firefox 20, vncanvas-0.4.1.zip. Modified vntemplate.html to use 
vncanvas-0.4.js instead of vncanvas-0.3.js. Modified vnconfig.js to correct an 
absent comma (see issue #13).

Working in Chrome.

Original issue reported on code.google.com by compulsi...@gmail.com on 6 May 2013 at 5:44

GoogleCodeExporter commented 9 years ago
line 3459 in vncanvas-0.4.js, i looks like even though the argument is an image 
file, it nonetheless runs the code in the else statement instead of the first 
conditional:

        if ((this.image.constructor == HTMLImageElement) || (this.image.constructor == Image)) {
            this.context.drawImage(this.image, 
                                ((this.context.canvas.width - this.backdropDim.vx)/2)>>0,
                                ((this.context.canvas.height - this.backdropDim.vy)/2)>>0);
        }
        else {
            this.context.fillStyle = this.image;
            this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);     
        }

Original comment by compulsi...@gmail.com on 6 May 2013 at 5:59

GoogleCodeExporter commented 9 years ago
Check issue 11 (http://code.google.com/p/vn-canvas/issues/detail?id=11)

Original comment by oclabbao on 7 May 2013 at 12:11

GoogleCodeExporter commented 9 years ago

Original comment by oclabbao on 22 May 2013 at 3:29