function renderLayout(scope = globalScope) {
    if (!layoutModeGet()) return;
    var ctx = simulationArea.context;
    simulationArea.clear();
    ctx.strokeStyle = 'black';
    ctx.fillStyle = 'white';
    ctx.lineWidth = correctWidth(3);
    // Draw base rectangle
    ctx.beginPath();
    rect2(ctx, 0, 0, tempBuffer.layout.width, tempBuffer.layout.height, 0, 0, "RIGHT");
    ctx.fill();
    ctx.stroke();
    ctx.beginPath();
    ctx.textAlign = 'center';
    ctx.fillStyle = 'black';
    if (tempBuffer.layout.titleEnabled) {
        fillText(ctx, scope.name, tempBuffer.layout.title_x, tempBuffer.layout.title_y, 11);
    }

    // Draw labels
    var info;
    for (let i = 0; i < tempBuffer.Input.length; i++) {
        if (!tempBuffer.Input[i].label) continue;
        info = determineLabel(tempBuffer.Input[i].x, tempBuffer.Input[i].y, scope);
        [ctx.textAlign] = info;
        fillText(ctx, tempBuffer.Input[i].label, tempBuffer.Input[i].x + info[1], tempBuffer.Input[i].y + info[2], 12);
    }
    for (let i = 0; i < tempBuffer.Output.length; i++) {
        if (!tempBuffer.Output[i].label) continue;
        info = determineLabel(tempBuffer.Output[i].x, tempBuffer.Output[i].y, scope);
        [ctx.textAlign] = info;
        fillText(ctx, tempBuffer.Output[i].label, tempBuffer.Output[i].x + info[1], tempBuffer.Output[i].y + info[2], 12);
    }
    ctx.fill();

    // Draw points
    for (let i = 0; i < tempBuffer.Input.length; i++) {
        tempBuffer.Input[i].draw();
    }
    for (let i = 0; i < tempBuffer.Output.length; i++) {
        tempBuffer.Output[i].draw();
    }

    if (gridUpdateGet()) {
        dots();
    }

     // Update UI position
    for(let i = 0; i < tempBuffer.subElements.length; i++){
        tempBuffer.subElements[i].update();

        // element nodes
        for(let j = 0; j < tempBuffer.subElements[i].nodeList.length; j++)
            tempBuffer.subElements[i].nodeList[j].update();
    }

    // Show properties of selected element
    if (!embed && prevPropertyObjGet() != simulationArea.lastSelected) {
        if (simulationArea.lastSelected) {
            showProperties(simulationArea.lastSelected);
        }
    }
    // Render objects
    for(let i = 0; i < circuitElementList.length; i++){
        if(globalScope[circuitElementList[i]].length === 0) continue;
        if (!globalScope[circuitElementList[i]][0].canShowInSubcircuit) continue;

        let elementName = circuitElementList[i];

        for(let j = 0; j < globalScope[elementName].length; j++){
            if (globalScope[elementName][j].subcircuitMetadata.showInSubcircuit) {
                globalScope[elementName][j].drawLayoutMode();
            }
        }
    }
}
Function to render layout on screen in layoutMode
@param {Scope=} scope
@category layoutMode