src/libraries/img/canvasrenderer.js
function calcLayerRect(iCanvas, layer) {
    var rect = transformRect(iCanvas, layer);
    rect = rectIntersect(rect, {x: 0, y: 0, width: iCanvas.width, height: iCanvas.height});
    return { x: Math.round(rect.x),
        y: Math.round(rect.y),
        width: Math.ceil(rect.width),
        height: Math.ceil(rect.height)};
}
function calcLayerRect(iCanvas, layer) {
    var rect = transformRect(iCanvas, layer);
    rect = rectIntersect(rect, {x: 0, y: 0, width: iCanvas.width, height: iCanvas.height});
    return { x: Math.round(rect.x),
        y: Math.round(rect.y),
        width: Math.ceil(rect.width),
        height: Math.ceil(rect.height)};
}
function calcLayerRect ( iCanvas , layer ) { var rect = transformRect ( iCanvas , layer ) ; rect = rectIntersect ( rect , { x : 0 , y : 0 , width : iCanvas . width , height : iCanvas . height } ) ; return { x : Math . round ( rect . x ) , y : Math . round ( rect . y ) , width : Math . ceil ( rect . width ) , height : Math . ceil ( rect . height ) } ; }
Calculates the mimimal area that a transformed layer needs so that it can still be drawn on the canvas. Returns a rectangle.
Calculates the mimimal area that a transformed layer needs so that it can still be drawn on the canvas . Returns a rectangle .