Set min Canvas Size

Hi there, I was wondering if it was possible to set a minimal size for the canvas ? Here is the code i want to use :

window.onresize = function() {
  if(c.width >= 600){
    c.size(window.innerWidth, c.height);
  if(c.height >= 400){
    c.size(c.width, window.innerHeight);

But i have some strange behavior : when i reduce the size of the window it works and limits the canvas size, but after that if i want to expand the window the sketch's size won't change anymore .... I guess i'm mistaking somewhere but can't see where ... Do you have any idea ?



Sign In or Register to comment.