mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:55:17 +08:00
added drawScene() method which only redraws the scene and not the buffer
This commit is contained in:
parent
e6e488025e
commit
f53c43d4f7
9
dist/kinetic-core.js
vendored
9
dist/kinetic-core.js
vendored
@ -3635,6 +3635,15 @@ Kinetic.Layer = Kinetic.Container.extend({
|
||||
drawBuffer: function() {
|
||||
this.draw(this.bufferCanvas);
|
||||
},
|
||||
/**
|
||||
* draw children nodes on scene. this includes any groups
|
||||
* or shapes
|
||||
* @name drawScene
|
||||
* @methodOf Kinetic.Layer.prototype
|
||||
*/
|
||||
drawScene: function() {
|
||||
this.draw(this.getCanvas());
|
||||
},
|
||||
/**
|
||||
* set before draw handler
|
||||
* @name beforeDraw
|
||||
|
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
@ -68,6 +68,15 @@ Kinetic.Layer = Kinetic.Container.extend({
|
||||
drawBuffer: function() {
|
||||
this.draw(this.bufferCanvas);
|
||||
},
|
||||
/**
|
||||
* draw children nodes on scene. this includes any groups
|
||||
* or shapes
|
||||
* @name drawScene
|
||||
* @methodOf Kinetic.Layer.prototype
|
||||
*/
|
||||
drawScene: function() {
|
||||
this.draw(this.getCanvas());
|
||||
},
|
||||
/**
|
||||
* set before draw handler
|
||||
* @name beforeDraw
|
||||
|
@ -4738,8 +4738,7 @@ Test.prototype.tests = {
|
||||
y: 10
|
||||
});
|
||||
var mapLayer = new Kinetic.Layer();
|
||||
var mapCanvas = mapLayer.getCanvas();
|
||||
|
||||
|
||||
for(var key in worldMap.shapes) {
|
||||
var c = worldMap.shapes[key];
|
||||
|
||||
@ -4755,12 +4754,12 @@ Test.prototype.tests = {
|
||||
|
||||
path.on('mouseover', function() {
|
||||
this.setFill('red');
|
||||
mapLayer.draw(mapCanvas);
|
||||
mapLayer.drawScene();
|
||||
});
|
||||
|
||||
path.on('mouseout', function() {
|
||||
this.setFill('#ccc');
|
||||
mapLayer.draw(mapCanvas);
|
||||
mapLayer.drawScene();
|
||||
});
|
||||
|
||||
mapLayer.add(path);
|
||||
|
Loading…
Reference in New Issue
Block a user