Documentation Canvas.js

This commit is contained in:
Erik Tiekstra
2017-06-13 10:25:42 +02:00
parent 4c16bac5a4
commit 2b4bb8ba37
+8
View File
@@ -1,4 +1,5 @@
'use strict';
var config = require('./config');
var util = require('./util');
var ApertureHandler = require('./ApertureHandler');
@@ -11,6 +12,11 @@ var ImageDataHandler = require('./ImageDataHandler');
var $document = $(document);
/**
* Canvas is using fabric to create the canvas and initiate it with its initial settings.
* It is also here most of the interaction is taking place. And most files are connected to this file.
* Fe. getDragbars method can be called from most places as the Canvas class is available in most places.
*/
var Canvas = fabric.util.createClass(fabric.Canvas, {
initialize: function (id) {
this.callSuper('initialize', id, {
@@ -24,6 +30,8 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
height: 600
});
// Eventhandler for mouseup events on the whole canvas.
// This should be rewritten a bit to not have that many events after the image has been cropped.
this.on('mouse:up', function () {
if (this.getImage().__cropped && !this.get3dHandler().isEnabled()) {
this.getApertures().setTransparent(false);