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'
}