ServerConfiguration/Calla/Calla-Lib/game/bundle.js
/**
     * Render the avatar at a certain size.
     * @param {CanvasRenderingContext2D} g - the context to render to
     * @param {number} width - the width the avatar should be rendered at
     * @param {number} height - the height the avatar should be rendered at.
     * @param {boolean} isMe - whether the avatar is the local user
     */
Render the avatar at a certain size.
@param {CanvasRenderingContext2D} g - the context to render to
@param {number} width - the width the avatar should be rendered at
@param {number} height - the height the avatar should be rendered at.
@param {boolean} isMe - whether the avatar is the local user
Render the avatar at a certain size . @param { CanvasRenderingContext2D } g - the context to render to @param { number } width - the width the avatar should be rendered at @param { number } height - the height the avatar should be rendered at . @param { boolean } isMe - whether the avatar is the local user
draw(g, width, height, isMe) {
        const aspectRatio = this.element.width / this.element.height,
            w = aspectRatio > 1 ? width : aspectRatio * height,
            h = aspectRatio > 1 ? width / aspectRatio : height,
            dx = (width - w) / 2,
            dy = (height - h) / 2;
        g.drawImage(
            this.element,
            dx, dy,
            w, h);
    }
draw ( g , width , height , isMe ) { const aspectRatio = this . element . width / this . element . height , w = aspectRatio > 1 ? width : aspectRatio * height , h = aspectRatio > 1 ? width / aspectRatio : height , dx = ( width - w ) / 2 , dy = ( height - h ) / 2 ; g . drawImage ( this . element , dx , dy , w , h ) ; }
Render the avatar at a certain size.
Render the avatar at a certain size .