mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 02:37:59 +08:00
changed createImageBuffer to createImageHitRegion for consistency
This commit is contained in:
@@ -132,12 +132,12 @@ Kinetic.Image.prototype = {
|
||||
/**
|
||||
* create image buffer which enables more accurate hit detection mapping of the image
|
||||
* by avoiding event detections for transparent pixels
|
||||
* @name createImageBuffer
|
||||
* @name createImageHitRegion
|
||||
* @methodOf Kinetic.Image.prototype
|
||||
* @param {Function} [callback] callback function to be called once
|
||||
* the buffer image has been created and set
|
||||
*/
|
||||
createImageBuffer: function(callback) {
|
||||
createImageHitRegion: function(callback) {
|
||||
var canvas = new Kinetic.Canvas(this.attrs.width, this.attrs.height);
|
||||
var context = canvas.getContext();
|
||||
context.drawImage(this.attrs.image, 0, 0);
|
||||
|
@@ -760,7 +760,7 @@ Test.Modules.NODE = {
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
|
||||
cachedShape.createImageBuffer(function() {
|
||||
cachedShape.createImageHitRegion(function() {
|
||||
|
||||
layer.draw();
|
||||
//console.log(layer.toDataURL());
|
||||
|
@@ -151,7 +151,7 @@ Test.Modules.IMAGE = {
|
||||
|
||||
layer.add(lion);
|
||||
|
||||
lion.createImageBuffer(function() {
|
||||
lion.createImageHitRegion(function() {
|
||||
stage.add(layer);
|
||||
layer.drawHit();
|
||||
|
||||
|
Reference in New Issue
Block a user