mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
changed bufferImage property to imageBuffer
This commit is contained in:
10
dist/kinetic-core.js
vendored
10
dist/kinetic-core.js
vendored
@@ -4128,8 +4128,8 @@ Kinetic.Shape = Kinetic.Node.extend({
|
|||||||
if('image' in this.attrs) {
|
if('image' in this.attrs) {
|
||||||
attrs.image = this.attrs.image;
|
attrs.image = this.attrs.image;
|
||||||
|
|
||||||
if(this.bufferImage) {
|
if(this.imageBuffer) {
|
||||||
this.attrs.image = this.bufferImage;
|
this.attrs.image = this.imageBuffer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.attrs.image = null;
|
this.attrs.image = null;
|
||||||
@@ -4534,14 +4534,14 @@ Kinetic.Image = Kinetic.Shape.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* create buffer image which enables more accurate hit detection mapping of the image
|
* create image buffer which enables more accurate hit detection mapping of the image
|
||||||
* by avoiding event detections for transparent pixels
|
* by avoiding event detections for transparent pixels
|
||||||
* @name createBufferImage
|
* @name createImageBuffer
|
||||||
* @methodOf Kinetic.Image.prototype
|
* @methodOf Kinetic.Image.prototype
|
||||||
* @param {Function} [callback] callback function to be called once
|
* @param {Function} [callback] callback function to be called once
|
||||||
* the buffer image has been created and set
|
* the buffer image has been created and set
|
||||||
*/
|
*/
|
||||||
createBufferImage: function(callback) {
|
createImageBuffer: function(callback) {
|
||||||
var canvas = new Kinetic.Canvas(this.attrs.width, this.attrs.height);
|
var canvas = new Kinetic.Canvas(this.attrs.width, this.attrs.height);
|
||||||
var context = canvas.getContext();
|
var context = canvas.getContext();
|
||||||
context.drawImage(this.attrs.image, 0, 0);
|
context.drawImage(this.attrs.image, 0, 0);
|
||||||
|
|||||||
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -387,8 +387,8 @@ Kinetic.Shape = Kinetic.Node.extend({
|
|||||||
if('image' in this.attrs) {
|
if('image' in this.attrs) {
|
||||||
attrs.image = this.attrs.image;
|
attrs.image = this.attrs.image;
|
||||||
|
|
||||||
if(this.bufferImage) {
|
if(this.imageBuffer) {
|
||||||
this.attrs.image = this.bufferImage;
|
this.attrs.image = this.imageBuffer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.attrs.image = null;
|
this.attrs.image = null;
|
||||||
|
|||||||
@@ -100,14 +100,14 @@ Kinetic.Image = Kinetic.Shape.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* create buffer image which enables more accurate hit detection mapping of the image
|
* create image buffer which enables more accurate hit detection mapping of the image
|
||||||
* by avoiding event detections for transparent pixels
|
* by avoiding event detections for transparent pixels
|
||||||
* @name createBufferImage
|
* @name createImageBuffer
|
||||||
* @methodOf Kinetic.Image.prototype
|
* @methodOf Kinetic.Image.prototype
|
||||||
* @param {Function} [callback] callback function to be called once
|
* @param {Function} [callback] callback function to be called once
|
||||||
* the buffer image has been created and set
|
* the buffer image has been created and set
|
||||||
*/
|
*/
|
||||||
createBufferImage: function(callback) {
|
createImageBuffer: function(callback) {
|
||||||
var canvas = new Kinetic.Canvas(this.attrs.width, this.attrs.height);
|
var canvas = new Kinetic.Canvas(this.attrs.width, this.attrs.height);
|
||||||
var context = canvas.getContext();
|
var context = canvas.getContext();
|
||||||
context.drawImage(this.attrs.image, 0, 0);
|
context.drawImage(this.attrs.image, 0, 0);
|
||||||
|
|||||||
@@ -1884,7 +1884,7 @@ Test.prototype.tests = {
|
|||||||
|
|
||||||
layer.add(cachedShape);
|
layer.add(cachedShape);
|
||||||
|
|
||||||
cachedShape.createBufferImage(function() {
|
cachedShape.createImageBuffer(function() {
|
||||||
|
|
||||||
layer.draw();
|
layer.draw();
|
||||||
|
|
||||||
@@ -2369,7 +2369,7 @@ Test.prototype.tests = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
layer.add(lion);
|
layer.add(lion);
|
||||||
lion.createBufferImage(function() {
|
lion.createImageBuffer(function() {
|
||||||
stage.add(layer);
|
stage.add(layer);
|
||||||
});
|
});
|
||||||
//document.body.appendChild(layer.bufferCanvas.element);
|
//document.body.appendChild(layer.bufferCanvas.element);
|
||||||
|
|||||||
Reference in New Issue
Block a user