mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
introduced new Context class. I've bumped up the next release to v4.7.0 because this is a relatively big mind shift in how the framework works, and it's a big enough API change to warrant a minor update. This is the first step towards enabling context tracing for stellar unit testing
This commit is contained in:
@@ -22,17 +22,19 @@
|
||||
Kinetic.Shape.call(this, config);
|
||||
this.className = ELLIPSE;
|
||||
},
|
||||
drawFunc: function(canvas) {
|
||||
var context = canvas.getContext(), r = this.getRadius();
|
||||
context.beginPath();
|
||||
context.save();
|
||||
drawFunc: function(context) {
|
||||
var _context = context._context,
|
||||
r = this.getRadius();
|
||||
|
||||
_context.beginPath();
|
||||
_context.save();
|
||||
if(r.x !== r.y) {
|
||||
context.scale(1, r.y / r.x);
|
||||
_context.scale(1, r.y / r.x);
|
||||
}
|
||||
context.arc(0, 0, r.x, 0, PIx2, false);
|
||||
context.restore();
|
||||
context.closePath();
|
||||
canvas.fillStroke(this);
|
||||
_context.arc(0, 0, r.x, 0, PIx2, false);
|
||||
_context.restore();
|
||||
_context.closePath();
|
||||
context.fillStroke(this);
|
||||
},
|
||||
getWidth: function() {
|
||||
return this.getRadius().x * 2;
|
||||
|
||||
Reference in New Issue
Block a user