mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
rewrote dynamic drag and drop layer because the old implementation had too many problems. This resolves all of the dynamic drag and drop issues in one go. draw() method can now be applied to any node, not just the Stage and Layers. drag events now bubble
This commit is contained in:
@@ -11,20 +11,28 @@
|
||||
* @param {Number} width
|
||||
* @param {Number} height
|
||||
*/
|
||||
Kinetic.Canvas = function(width, height, pixelRatio) {
|
||||
this.pixelRatio = pixelRatio || _pixelRatio;
|
||||
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);
|
||||
Kinetic.Canvas = function(config) {
|
||||
this.init(config);
|
||||
};
|
||||
|
||||
Kinetic.Canvas.prototype = {
|
||||
init: function(config) {
|
||||
var config = config || {},
|
||||
width = config.width || 0,
|
||||
height = config.height || 0,
|
||||
pixelRatio = config.pixelRatio || _pixelRatio;
|
||||
|
||||
this.pixelRatio = pixelRatio;
|
||||
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, height);
|
||||
},
|
||||
/**
|
||||
* clear canvas
|
||||
* @name clear
|
||||
|
||||
Reference in New Issue
Block a user