Line data Source code
1 : /** 2 : * The MultiPainter applies several painters to the given area. 3 : */ 4 : function MultiPainter(painters) 5 : { 6 10 : if (painters instanceof Array) 7 1 : this.painters = painters; 8 9 : else if (!painters) 9 8 : this.painters = []; 10 : else 11 1 : this.painters = [painters]; 12 : } 13 : 14 6 : MultiPainter.prototype.paint = function(area) 15 : { 16 10 : for (let painter of this.painters) 17 3 : painter.paint(area); 18 : };