centring the canvas moves it in the corner












2















I am trying to centre my whole canvas in the middle so I can scale it, as the edges are not complete and I can't fill up the space using values lower or bigger than the canvas as it bring up errors. Here is a picture without scaling and with scaling.



var rows = 10;
var cols = 10;
var points = ;
var sat = 70;
var bright = 80;
var timesDrawed = 0;

function setup() {
createCanvas(600, 600);
colorMode(HSB, 100, 100, 100);
noStroke();
rectMode(CENTER);
}

function draw() {
translate(width/2,height/2);
if (timesDrawed >= 3) {
noLoop();
} else {
timesDrawed++;
}
scale(1.2);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
var tempX = random((width / (cols)) * c - (width / cols * 0.5), (width / (cols)) * c + (width / cols * 0.5));
var tempY = random((height / (rows)) * r - (height / rows * 0.5), (height / (rows)) * r + (height / rows * 0.5));
points.push([tempX, tempY]);
}
}
print(points);
for (var r = 0; r < rows - 1; r++) {
for (var c = 0; c < cols -1; c++) {
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows);
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows) + rows;
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows + 1;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
}
}
}









share|improve this question























  • Did the answer solve the issue? Are there remaining questions?

    – Rabbid76
    Feb 10 at 10:38
















2















I am trying to centre my whole canvas in the middle so I can scale it, as the edges are not complete and I can't fill up the space using values lower or bigger than the canvas as it bring up errors. Here is a picture without scaling and with scaling.



var rows = 10;
var cols = 10;
var points = ;
var sat = 70;
var bright = 80;
var timesDrawed = 0;

function setup() {
createCanvas(600, 600);
colorMode(HSB, 100, 100, 100);
noStroke();
rectMode(CENTER);
}

function draw() {
translate(width/2,height/2);
if (timesDrawed >= 3) {
noLoop();
} else {
timesDrawed++;
}
scale(1.2);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
var tempX = random((width / (cols)) * c - (width / cols * 0.5), (width / (cols)) * c + (width / cols * 0.5));
var tempY = random((height / (rows)) * r - (height / rows * 0.5), (height / (rows)) * r + (height / rows * 0.5));
points.push([tempX, tempY]);
}
}
print(points);
for (var r = 0; r < rows - 1; r++) {
for (var c = 0; c < cols -1; c++) {
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows);
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows) + rows;
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows + 1;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
}
}
}









share|improve this question























  • Did the answer solve the issue? Are there remaining questions?

    – Rabbid76
    Feb 10 at 10:38














2












2








2








I am trying to centre my whole canvas in the middle so I can scale it, as the edges are not complete and I can't fill up the space using values lower or bigger than the canvas as it bring up errors. Here is a picture without scaling and with scaling.



var rows = 10;
var cols = 10;
var points = ;
var sat = 70;
var bright = 80;
var timesDrawed = 0;

function setup() {
createCanvas(600, 600);
colorMode(HSB, 100, 100, 100);
noStroke();
rectMode(CENTER);
}

function draw() {
translate(width/2,height/2);
if (timesDrawed >= 3) {
noLoop();
} else {
timesDrawed++;
}
scale(1.2);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
var tempX = random((width / (cols)) * c - (width / cols * 0.5), (width / (cols)) * c + (width / cols * 0.5));
var tempY = random((height / (rows)) * r - (height / rows * 0.5), (height / (rows)) * r + (height / rows * 0.5));
points.push([tempX, tempY]);
}
}
print(points);
for (var r = 0; r < rows - 1; r++) {
for (var c = 0; c < cols -1; c++) {
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows);
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows) + rows;
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows + 1;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
}
}
}









share|improve this question














I am trying to centre my whole canvas in the middle so I can scale it, as the edges are not complete and I can't fill up the space using values lower or bigger than the canvas as it bring up errors. Here is a picture without scaling and with scaling.



var rows = 10;
var cols = 10;
var points = ;
var sat = 70;
var bright = 80;
var timesDrawed = 0;

function setup() {
createCanvas(600, 600);
colorMode(HSB, 100, 100, 100);
noStroke();
rectMode(CENTER);
}

function draw() {
translate(width/2,height/2);
if (timesDrawed >= 3) {
noLoop();
} else {
timesDrawed++;
}
scale(1.2);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
var tempX = random((width / (cols)) * c - (width / cols * 0.5), (width / (cols)) * c + (width / cols * 0.5));
var tempY = random((height / (rows)) * r - (height / rows * 0.5), (height / (rows)) * r + (height / rows * 0.5));
points.push([tempX, tempY]);
}
}
print(points);
for (var r = 0; r < rows - 1; r++) {
for (var c = 0; c < cols -1; c++) {
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows);
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows) + rows;
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows + 1;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
}
}
}






javascript processing p5.js






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 '18 at 13:24









Tudor PopescuTudor Popescu

16110




16110













  • Did the answer solve the issue? Are there remaining questions?

    – Rabbid76
    Feb 10 at 10:38



















  • Did the answer solve the issue? Are there remaining questions?

    – Rabbid76
    Feb 10 at 10:38

















Did the answer solve the issue? Are there remaining questions?

– Rabbid76
Feb 10 at 10:38





Did the answer solve the issue? Are there remaining questions?

– Rabbid76
Feb 10 at 10:38












1 Answer
1






active

oldest

votes


















1














If the canvas is tiled in columns (cols) and rows rows, then the start of each column is c * width/cols and the end of each column is (c+1) * width/cols, the start of each row is (r * height/rowsand the end of each row is(r+1) * height/rows, wherecis the column andr` is the row.



Since the center of the canvas is (0, 0), the half with and the half height have to be subtracted from the coordinate:



var tempX = random(c * width/cols  - width/2,  (c+1) * width/cols  - width/2); 
var tempY = random(r * height/rows - height/2, (r+1) * height/rows - height/2);


or



var tempX = random(c, c+1) * width/cols  - width/2; 
var tempY = random(r, r+1) * height/rows - height/2;


See the preview, where I applied the suggested changes to your original code and I removed the scale scale(1.2):






var rows = 10;
var cols = 10;
var points = ;
var sat = 70;
var bright = 80;
var timesDrawed = 0;

function setup() {
createCanvas(400, 400);
colorMode(HSB, 100, 100, 100);
noStroke();
rectMode(CENTER);
}

function draw() {
background(64);
translate(width/2,height/2);
if (timesDrawed >= 3) {
noLoop();
} else {
timesDrawed++;
}
//scale(1.2);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
var tempX = random(c, c+1) * width/cols - width/2;
var tempY = random(r, r+1) * height/rows - height/2;
points.push([tempX, tempY]);
}
}
print(points);
for (var r = 0; r < rows - 1; r++) {
for (var c = 0; c < cols -1; c++) {
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows);
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
fill(random(0, 100), sat, bright);
var point1 = c + (r * rows) + rows;
var point2 = c + (r * rows) + 1;
var point3 = c + (r * rows) + rows + 1;
triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
}
}
}

<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>








share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467926%2fcentring-the-canvas-moves-it-in-the-corner%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If the canvas is tiled in columns (cols) and rows rows, then the start of each column is c * width/cols and the end of each column is (c+1) * width/cols, the start of each row is (r * height/rowsand the end of each row is(r+1) * height/rows, wherecis the column andr` is the row.



    Since the center of the canvas is (0, 0), the half with and the half height have to be subtracted from the coordinate:



    var tempX = random(c * width/cols  - width/2,  (c+1) * width/cols  - width/2); 
    var tempY = random(r * height/rows - height/2, (r+1) * height/rows - height/2);


    or



    var tempX = random(c, c+1) * width/cols  - width/2; 
    var tempY = random(r, r+1) * height/rows - height/2;


    See the preview, where I applied the suggested changes to your original code and I removed the scale scale(1.2):






    var rows = 10;
    var cols = 10;
    var points = ;
    var sat = 70;
    var bright = 80;
    var timesDrawed = 0;

    function setup() {
    createCanvas(400, 400);
    colorMode(HSB, 100, 100, 100);
    noStroke();
    rectMode(CENTER);
    }

    function draw() {
    background(64);
    translate(width/2,height/2);
    if (timesDrawed >= 3) {
    noLoop();
    } else {
    timesDrawed++;
    }
    //scale(1.2);
    for (var r = 0; r < rows; r++) {
    for (var c = 0; c < cols; c++) {
    var tempX = random(c, c+1) * width/cols - width/2;
    var tempY = random(r, r+1) * height/rows - height/2;
    points.push([tempX, tempY]);
    }
    }
    print(points);
    for (var r = 0; r < rows - 1; r++) {
    for (var c = 0; c < cols -1; c++) {
    fill(random(0, 100), sat, bright);
    var point1 = c + (r * rows);
    var point2 = c + (r * rows) + 1;
    var point3 = c + (r * rows) + rows;
    triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
    fill(random(0, 100), sat, bright);
    var point1 = c + (r * rows) + rows;
    var point2 = c + (r * rows) + 1;
    var point3 = c + (r * rows) + rows + 1;
    triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
    }
    }
    }

    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>








    share|improve this answer






























      1














      If the canvas is tiled in columns (cols) and rows rows, then the start of each column is c * width/cols and the end of each column is (c+1) * width/cols, the start of each row is (r * height/rowsand the end of each row is(r+1) * height/rows, wherecis the column andr` is the row.



      Since the center of the canvas is (0, 0), the half with and the half height have to be subtracted from the coordinate:



      var tempX = random(c * width/cols  - width/2,  (c+1) * width/cols  - width/2); 
      var tempY = random(r * height/rows - height/2, (r+1) * height/rows - height/2);


      or



      var tempX = random(c, c+1) * width/cols  - width/2; 
      var tempY = random(r, r+1) * height/rows - height/2;


      See the preview, where I applied the suggested changes to your original code and I removed the scale scale(1.2):






      var rows = 10;
      var cols = 10;
      var points = ;
      var sat = 70;
      var bright = 80;
      var timesDrawed = 0;

      function setup() {
      createCanvas(400, 400);
      colorMode(HSB, 100, 100, 100);
      noStroke();
      rectMode(CENTER);
      }

      function draw() {
      background(64);
      translate(width/2,height/2);
      if (timesDrawed >= 3) {
      noLoop();
      } else {
      timesDrawed++;
      }
      //scale(1.2);
      for (var r = 0; r < rows; r++) {
      for (var c = 0; c < cols; c++) {
      var tempX = random(c, c+1) * width/cols - width/2;
      var tempY = random(r, r+1) * height/rows - height/2;
      points.push([tempX, tempY]);
      }
      }
      print(points);
      for (var r = 0; r < rows - 1; r++) {
      for (var c = 0; c < cols -1; c++) {
      fill(random(0, 100), sat, bright);
      var point1 = c + (r * rows);
      var point2 = c + (r * rows) + 1;
      var point3 = c + (r * rows) + rows;
      triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
      fill(random(0, 100), sat, bright);
      var point1 = c + (r * rows) + rows;
      var point2 = c + (r * rows) + 1;
      var point3 = c + (r * rows) + rows + 1;
      triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
      }
      }
      }

      <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>








      share|improve this answer




























        1












        1








        1







        If the canvas is tiled in columns (cols) and rows rows, then the start of each column is c * width/cols and the end of each column is (c+1) * width/cols, the start of each row is (r * height/rowsand the end of each row is(r+1) * height/rows, wherecis the column andr` is the row.



        Since the center of the canvas is (0, 0), the half with and the half height have to be subtracted from the coordinate:



        var tempX = random(c * width/cols  - width/2,  (c+1) * width/cols  - width/2); 
        var tempY = random(r * height/rows - height/2, (r+1) * height/rows - height/2);


        or



        var tempX = random(c, c+1) * width/cols  - width/2; 
        var tempY = random(r, r+1) * height/rows - height/2;


        See the preview, where I applied the suggested changes to your original code and I removed the scale scale(1.2):






        var rows = 10;
        var cols = 10;
        var points = ;
        var sat = 70;
        var bright = 80;
        var timesDrawed = 0;

        function setup() {
        createCanvas(400, 400);
        colorMode(HSB, 100, 100, 100);
        noStroke();
        rectMode(CENTER);
        }

        function draw() {
        background(64);
        translate(width/2,height/2);
        if (timesDrawed >= 3) {
        noLoop();
        } else {
        timesDrawed++;
        }
        //scale(1.2);
        for (var r = 0; r < rows; r++) {
        for (var c = 0; c < cols; c++) {
        var tempX = random(c, c+1) * width/cols - width/2;
        var tempY = random(r, r+1) * height/rows - height/2;
        points.push([tempX, tempY]);
        }
        }
        print(points);
        for (var r = 0; r < rows - 1; r++) {
        for (var c = 0; c < cols -1; c++) {
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows);
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows) + rows;
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows + 1;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        }
        }
        }

        <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>








        share|improve this answer















        If the canvas is tiled in columns (cols) and rows rows, then the start of each column is c * width/cols and the end of each column is (c+1) * width/cols, the start of each row is (r * height/rowsand the end of each row is(r+1) * height/rows, wherecis the column andr` is the row.



        Since the center of the canvas is (0, 0), the half with and the half height have to be subtracted from the coordinate:



        var tempX = random(c * width/cols  - width/2,  (c+1) * width/cols  - width/2); 
        var tempY = random(r * height/rows - height/2, (r+1) * height/rows - height/2);


        or



        var tempX = random(c, c+1) * width/cols  - width/2; 
        var tempY = random(r, r+1) * height/rows - height/2;


        See the preview, where I applied the suggested changes to your original code and I removed the scale scale(1.2):






        var rows = 10;
        var cols = 10;
        var points = ;
        var sat = 70;
        var bright = 80;
        var timesDrawed = 0;

        function setup() {
        createCanvas(400, 400);
        colorMode(HSB, 100, 100, 100);
        noStroke();
        rectMode(CENTER);
        }

        function draw() {
        background(64);
        translate(width/2,height/2);
        if (timesDrawed >= 3) {
        noLoop();
        } else {
        timesDrawed++;
        }
        //scale(1.2);
        for (var r = 0; r < rows; r++) {
        for (var c = 0; c < cols; c++) {
        var tempX = random(c, c+1) * width/cols - width/2;
        var tempY = random(r, r+1) * height/rows - height/2;
        points.push([tempX, tempY]);
        }
        }
        print(points);
        for (var r = 0; r < rows - 1; r++) {
        for (var c = 0; c < cols -1; c++) {
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows);
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows) + rows;
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows + 1;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        }
        }
        }

        <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>








        var rows = 10;
        var cols = 10;
        var points = ;
        var sat = 70;
        var bright = 80;
        var timesDrawed = 0;

        function setup() {
        createCanvas(400, 400);
        colorMode(HSB, 100, 100, 100);
        noStroke();
        rectMode(CENTER);
        }

        function draw() {
        background(64);
        translate(width/2,height/2);
        if (timesDrawed >= 3) {
        noLoop();
        } else {
        timesDrawed++;
        }
        //scale(1.2);
        for (var r = 0; r < rows; r++) {
        for (var c = 0; c < cols; c++) {
        var tempX = random(c, c+1) * width/cols - width/2;
        var tempY = random(r, r+1) * height/rows - height/2;
        points.push([tempX, tempY]);
        }
        }
        print(points);
        for (var r = 0; r < rows - 1; r++) {
        for (var c = 0; c < cols -1; c++) {
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows);
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows) + rows;
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows + 1;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        }
        }
        }

        <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>





        var rows = 10;
        var cols = 10;
        var points = ;
        var sat = 70;
        var bright = 80;
        var timesDrawed = 0;

        function setup() {
        createCanvas(400, 400);
        colorMode(HSB, 100, 100, 100);
        noStroke();
        rectMode(CENTER);
        }

        function draw() {
        background(64);
        translate(width/2,height/2);
        if (timesDrawed >= 3) {
        noLoop();
        } else {
        timesDrawed++;
        }
        //scale(1.2);
        for (var r = 0; r < rows; r++) {
        for (var c = 0; c < cols; c++) {
        var tempX = random(c, c+1) * width/cols - width/2;
        var tempY = random(r, r+1) * height/rows - height/2;
        points.push([tempX, tempY]);
        }
        }
        print(points);
        for (var r = 0; r < rows - 1; r++) {
        for (var c = 0; c < cols -1; c++) {
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows);
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        fill(random(0, 100), sat, bright);
        var point1 = c + (r * rows) + rows;
        var point2 = c + (r * rows) + 1;
        var point3 = c + (r * rows) + rows + 1;
        triangle(points[point1][0], points[point1][1], points[point2][0], points[point2][1], points[point3][0], points[point3][1]);
        }
        }
        }

        <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 25 '18 at 16:47

























        answered Nov 25 '18 at 16:25









        Rabbid76Rabbid76

        39.8k123251




        39.8k123251
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467926%2fcentring-the-canvas-moves-it-in-the-corner%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python