0

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'
    }
2
Contributors
3
Replies
7
Views
2 Years
Discussion Span
Last Post by diafol
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.