canvas elements now come with padding, margin, border, and background style resets

This commit is contained in:
Eric Rowell
2013-02-15 15:18:02 -08:00
parent 4d420efabd
commit ca0d3790b2
2 changed files with 35 additions and 0 deletions

View File

@@ -16,6 +16,10 @@
this.width = width;
this.height = height;
this.element = document.createElement('canvas');
this.element.style.padding = '0';
this.element.style.margin = '0';
this.element.style.border = '0';
this.element.style.background = 'transparent';
this.context = this.element.getContext('2d');
this.setSize(width || 0, height || 0);
};