src/drawer.multicanvas.js
/**
     * Draw a rectangle on the multi-canvas
     *
     * @param {number} x X-position of the rectangle
     * @param {number} y Y-position of the rectangle
     * @param {number} width Width of the rectangle
     * @param {number} height Height of the rectangle
     */
Draw a rectangle on the multi-canvas
@param {number} x X-position of the rectangle
@param {number} y Y-position of the rectangle
@param {number} width Width of the rectangle
@param {number} height Height of the rectangle
Draw a rectangle on the multi - canvas @param { number } x X - position of the rectangle @param { number } y Y - position of the rectangle @param { number } width Width of the rectangle @param { number } height Height of the rectangle
fillRect(x, y, width, height) {
        const startCanvas = Math.floor(x / this.maxCanvasWidth);
        const endCanvas = Math.min(
            Math.ceil((x + width) / this.maxCanvasWidth) + 1,
            this.canvases.length
        );
        let i = startCanvas;
        for (i; i < endCanvas; i++) {
            const entry = this.canvases[i];
            const leftOffset = i * this.maxCanvasWidth;
            const intersection = {
                x1: Math.max(x, i * this.maxCanvasWidth),
                y1: y,
                x2: Math.min(
                    x + width,
                    i * this.maxCanvasWidth + entry.wave.width
                ),
                y2: y + height
            };
            if (intersection.x1 < intersection.x2) {
                this.setFillStyles(entry);
                entry.fillRects(
                    intersection.x1 - leftOffset,
                    intersection.y1,
                    intersection.x2 - intersection.x1,
                    intersection.y2 - intersection.y1
                );
            }
        }
    }
fillRect ( x , y , width , height ) { const startCanvas = Math . floor ( x / this . maxCanvasWidth ) ; const endCanvas = Math . min ( Math . ceil ( ( x + width ) / this . maxCanvasWidth ) + 1 , this . canvases . length ) ; let i = startCanvas ; for ( i ; i < endCanvas ; i ++ ) { const entry = this . canvases [ i ] ; const leftOffset = i * this . maxCanvasWidth ; const intersection = { x1 : Math . max ( x , i * this . maxCanvasWidth ) , y1 : y , x2 : Math . min ( x + width , i * this . maxCanvasWidth + entry . wave . width ) , y2 : y + height } ; if ( intersection . x1 < intersection . x2 ) { this . setFillStyles ( entry ) ; entry . fillRects ( intersection . x1 - leftOffset , intersection . y1 , intersection . x2 - intersection . x1 , intersection . y2 - intersection . y1 ) ; } } }
Draw a rectangle on the multi-canvas
 @param {number} x X-position of the rectangle
 @param {number} y Y-position of the rectangle
 @param {number} width Width of the rectangle
 @param {number} height Height of the rectangle
Draw a rectangle on the multi - canvas @param { number } x X - position of the rectangle @param { number } y Y - position of the rectangle @param { number } width Width of the rectangle @param { number } height Height of the rectangle