mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 00:36:20 +08:00
when using pixel detection, clear shape data whenever shape is drawn
This commit is contained in:
parent
2dff730081
commit
dc45f5e2d6
7
dist/kinetic-core.js
vendored
7
dist/kinetic-core.js
vendored
@ -3,7 +3,7 @@
|
|||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2012, Eric Rowell
|
* Copyright 2012, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: Apr 03 2012
|
* Date: Apr 04 2012
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||||
*
|
*
|
||||||
@ -1995,6 +1995,11 @@ Kinetic.Shape.prototype = {
|
|||||||
this.drawFunc.call(this);
|
this.drawFunc.call(this);
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear shape data
|
||||||
|
if(this.detectionType === 'pixel') {
|
||||||
|
this.data = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* custom isPointInPath method which can use path detection
|
* custom isPointInPath method which can use path detection
|
||||||
|
6
dist/kinetic-core.min.js
vendored
6
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -193,6 +193,11 @@ Kinetic.Shape.prototype = {
|
|||||||
this.drawFunc.call(this);
|
this.drawFunc.call(this);
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear shape data
|
||||||
|
if(this.detectionType === 'pixel') {
|
||||||
|
this.data = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* custom isPointInPath method which can use path detection
|
* custom isPointInPath method which can use path detection
|
||||||
|
@ -10,7 +10,7 @@ function log(message) {
|
|||||||
* Test constructor
|
* Test constructor
|
||||||
*/
|
*/
|
||||||
function Test() {
|
function Test() {
|
||||||
this.testOnly = '';
|
this.testOnly = 'EVENTS - star pixel detection';
|
||||||
this.counter = 0;
|
this.counter = 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ Test.prototype.tests = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
'TRANSITION - all transition types': function(containerId) {
|
'TRANSITION - all transition types': function(containerId) {
|
||||||
document.getElementById(containerId).style.height = '300px';
|
document.getElementById(containerId).style.height = '300px';
|
||||||
|
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
|
Loading…
Reference in New Issue
Block a user