Created
October 23, 2013 21:03
-
-
Save blabno/7126723 to your computer and use it in GitHub Desktop.
Attempt for custom KineticJS shape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This actually doesn't work.