Skip to content

Instantly share code, notes, and snippets.

@blabno
Created October 23, 2013 21:03
Show Gist options
  • Save blabno/7126723 to your computer and use it in GitHub Desktop.
Save blabno/7126723 to your computer and use it in GitHub Desktop.
Attempt for custom KineticJS shape
(function ()
{
Kinetic.Link = function (config)
{
this.____init(config);
};
Kinetic.Link.prototype = {
____init: function (config)
{
// call super constructor
Kinetic.Text.call(this, config);
this.className = 'Link';
},
drawFunc: function (context)
{
Kinetic.Text.prototype.drawFunc.call(this, context);
var y = this.getLineHeight() * this.getTextHeight();
context.beginPath();
context.moveTo(0, y);
context.lineTo(this.getWidth(), y);
context.strokeShape(this);
}
};
Kinetic.Util.extend(Kinetic.Link, Kinetic.Text);
})();
@blabno
Copy link
Author

blabno commented Oct 23, 2013

This actually doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment