self.setTextAlign = function(value) { setActiveProp('textAlign', value.toLowerCase()); }; // Reset Zoom self.resetZoom = function(cb) { var width = canvas.getWidth(); var height = canvas.getHeight(); var tempWidth = width * (1 / canvas.scale); var tempHeight = height * (1 / canvas.scale); canvas.setWidth(tempWidth); canvas.setHeight(tempHeight); canvas.scale = 1; canvas.setZoom(1); if (cb) { cb(); } }; // Zoom In self.zoomIn = function() { canvas.scale = canvas.scale * SCALE_FACTOR; canvas.setZoom(canvas.scale); var width = canvas.getWidth(); var height = canvas.getHeight(); var tempWidth = width * SCALE_FACTOR; var tempHeight = height * SCALE_FACTOR; canvas.setWidth(tempWidth); canvas.setHeight(tempHeight); }; // Zoom Out self.zoomOut = function() { canvas.scale = self.canvas.scale / SCALE_FACTOR; canvas.setZoom(canvas.scale); var width = canvas.getWidth(); var height = canvas.getHeight(); var tempWidth = width * (1 / SCALE_FACTOR); var tempHeight = height * (1 / SCALE_FACTOR); canvas.setWidth(tempWidth); canvas.setHeight(tempHeight); };