bonjour, je suis confront� � un plantage de firefox � chaque chargement d'une image dans mon canvas.
voici le code utilis�:
Picture.js:
Comme vous le voyez la classe picture �tend de Item. je pourrais la d�tailler si besoin.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 fonction Picture(src, x, y, width, height){ Picture.call(this,x, y); this.src = src; this.width = width; this.height =height; } Picture.prototype = new Item(); Picture.prototype.constructor = Picture; Picture.prototype.draw = function() { var img = new Image(); img.src = this.src; img.onload = function() { this.ctx.drawImage(img, this.x, this.y, this.width, this.height); } }
Quelqu'un a une id�e du pourquoi firefox plante?
Partager