function recalculateMaxLevel() {
        var malakh = that.malakh,
            tiledImages = malakh.tiledImages,
            viewport = malakh.viewport;

        var viewportMaxLevel = 0, minTiledImageWidthScale = Infinity;
        for (var i = 0; i < tiledImages.length; i++) {
            var tiledImage = tiledImages[i];
            if (tiledImage instanceof Malakh.TiledImage && tiledImage.opacity > 0) { // tiled image has been loaded
                viewportMaxLevel = Math.max(
                    viewportMaxLevel,
                    tiledImage.getViewportLevel(tiledImage.maxLevel)
                );
                minTiledImageWidthScale = Math.min(minTiledImageWidthScale, tiledImage.getWidthScale());
            }
        }
        viewport.maxLevel = viewportMaxLevel;
        viewport.minTiledImageWidthScale = minTiledImageWidthScale;
    }
/**
     * Computes maximum level to be drawn on canvas. Note that it's not simply
     * maximum of all <code>tiledImage.maxLevel<code>s - their levels all scaled so that
     * they match "virtual" levels with regards to their representation on canvas.
     *
     * @see Malakh.TiledImage#getTiledImageLevel
     * @private
     */
Computes maximum level to be drawn on canvas. Note that it's not simply
maximum of all tiledImage.maxLevels - their levels all scaled so that
they match "virtual" levels with regards to their representation on canvas.


Computes maximum level to be drawn on canvas . Note that it ' s not simply maximum of all tiledImage . maxLevels - their levels all scaled so that they match " virtual " levels with regards to their representation on canvas .
function recalculateMaxLevel() {
        var malakh = that.malakh,
            tiledImages = malakh.tiledImages,
            viewport = malakh.viewport;
        var viewportMaxLevel = 0, minTiledImageWidthScale = Infinity;
        for (var i = 0; i < tiledImages.length; i++) {
            var tiledImage = tiledImages[i];
            if (tiledImage instanceof Malakh.TiledImage && tiledImage.opacity > 0) { 
                viewportMaxLevel = Math.max(
                    viewportMaxLevel,
                    tiledImage.getViewportLevel(tiledImage.maxLevel)
                );
                minTiledImageWidthScale = Math.min(minTiledImageWidthScale, tiledImage.getWidthScale());
            }
        }
        viewport.maxLevel = viewportMaxLevel;
        viewport.minTiledImageWidthScale = minTiledImageWidthScale;
    }
function recalculateMaxLevel ( ) { var malakh = that . malakh , tiledImages = malakh . tiledImages , viewport = malakh . viewport ; var viewportMaxLevel = 0 , minTiledImageWidthScale = Infinity ; for ( var i = 0 ; i < tiledImages . length ; i ++ ) { var tiledImage = tiledImages [ i ] ; if ( tiledImage instanceof Malakh . TiledImage && tiledImage . opacity > 0 ) { viewportMaxLevel = Math . max ( viewportMaxLevel , tiledImage . getViewportLevel ( tiledImage . maxLevel ) ) ; minTiledImageWidthScale = Math . min ( minTiledImageWidthScale , tiledImage . getWidthScale ( ) ) ; } } viewport . maxLevel = viewportMaxLevel ; viewport . minTiledImageWidthScale = minTiledImageWidthScale ; }
Computes maximum level to be drawn on canvas.
Computes maximum level to be drawn on canvas .
// tiled image has been loaded