I have Canvas page which displays canvas div vertically. Now, I want to horizontally oriented; I tried but can't success.

Below is the code:

var  ctx; 
    var extId = "fglkbiekhcllcfgdmbcadcfdgfgigoaj"; 
    jQuery(document).ready(function()
    {
        /* Extensiion ID of the Chrome App. */

        /* Getting the Port Reference and Setting Max XY*/
        var port = chrome.runtime.connect(extId);
        MAX_X = 20280.0
        MAX_Y = 13942.0
        activeCanvas("canvas1");


    });

    function activeCanvas(canvasid)
    {
        jQuery("#"+canvasid+"overlay").hide();
        var canvas = document.getElementById(canvasid);
        ctx = canvas.getContext('2d');

        ctx.scale(canvas.width / MAX_Y, canvas.height / MAX_X)
        ctx.rotate(-Math.PI / 2)
        ctx.translate(-MAX_X, 0)
        ctx.fillStyle   = '#000000'
        ctx.lineCap     = 'round'
        ctx.lineJoin    = 'round'
    }
Member Avatar for diafol

Is this for a chrome extension?

Member Avatar for diafol

So what's happening at the moment? Screenshot?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.